<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>2.1.3.1. Entity Data Model (EDM) &mdash; Pyslet 0.4.20140526 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.4.20140526',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Pyslet 0.4.20140526 documentation" href="index.html" />
    <link rel="up" title="2.1.3. OData Reference" href="odatav2_reference.html" />
    <link rel="next" title="2.1.3.2. OData Core Classes" href="odatav2_core.html" />
    <link rel="prev" title="2.1.3. OData Reference" href="odatav2_reference.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="odatav2_core.html" title="2.1.3.2. OData Core Classes"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="odatav2_reference.html" title="2.1.3. OData Reference"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="general.html" >2. Supporting Standards</a> &raquo;</li>
          <li><a href="odatav2.html" >2.1. The Open Data Protocol (OData)</a> &raquo;</li>
          <li><a href="odatav2_reference.html" accesskey="U">2.1.3. OData Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyslet.odata2.csdl">
<span id="entity-data-model-edm"></span><h1>2.1.3.1. Entity Data Model (EDM)<a class="headerlink" href="#module-pyslet.odata2.csdl" title="Permalink to this headline">¶</a></h1>
<p>This module defines functions and classes for working with data based on
Microsoft&#8217;s Entity Data Model (EDM) as documented by the Conceptual
Schema Definition Language and associated file format:
<a class="reference external" href="http://msdn.microsoft.com/en-us/library/dd541474.aspx">http://msdn.microsoft.com/en-us/library/dd541474.aspx</a></p>
<p>The classes in this model fall in to two categories.  The data classes
represent the actual data objects, like simple and complex values,
entities and collections.  The metadata classes represent the elements
of the metadata model like entity types, property definitions,
associations, entity sets and so on.  The metadata elements have direct
XML representations, the data classes do not.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<div class="section" id="data-model">
<h2>2.1.3.1.1. Data Model<a class="headerlink" href="#data-model" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.odata2.csdl.EntityCollection">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EntityCollection</tt><big>(</big><em>entitySet</em>, <em>**kwArgs</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike" title="pyslet.odata2.csdl.DictionaryLike"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.DictionaryLike</span></tt></a></p>
<p>Represents a collection of entities from an <a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a>.</p>
<p>To use a database analogy, EntitySet&#8217;s are like tables whereas
EntityCollections are more like the database cursors that you use to
execute data access commands.  An entity collection may consume
physical resources (like a database connection) and so should be
closed with the <tt class="xref py py-meth docutils literal"><span class="pre">close()</span></tt> method when you&#8217;re done.</p>
<p>Entity collections support the context manager protocol in python so
you can use them in with statements to make clean-up easier:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="n">entitySet</span><span class="o">.</span><span class="n">OpenCollection</span><span class="p">()</span> <span class="k">as</span> <span class="n">collection</span><span class="p">:</span>
        <span class="k">if</span> <span class="mi">42</span> <span class="ow">in</span> <span class="n">collection</span><span class="p">:</span>
                <span class="k">print</span> <span class="s">&quot;Found it!&quot;</span>
</pre></div>
</div>
<p>The close method is called automatically when the with statement
exits.</p>
<p>Entity collections also behave like a python dictionary of
<a class="reference internal" href="#pyslet.odata2.csdl.Entity" title="pyslet.odata2.csdl.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a> instances keyed on a value representing the
Entity&#8217;s key property or properties.  The keys are either single
values (as in the above code example) or tuples in the case of
compound keys. The order of the values in the tuple is taken from
the order of the <a class="reference internal" href="#pyslet.odata2.csdl.PropertyRef" title="pyslet.odata2.csdl.PropertyRef"><tt class="xref py py-class docutils literal"><span class="pre">PropertyRef</span></tt></a> definitions in the metadata
model.  You can obtain an entity&#8217;s key from the
<a class="reference internal" href="#pyslet.odata2.csdl.Entity.Key" title="pyslet.odata2.csdl.Entity.Key"><tt class="xref py py-meth docutils literal"><span class="pre">Entity.Key()</span></tt></a> method.</p>
<p>When an EntityCollection represents an entire entity set you cannot
use dictionary assignment to modify the collection.  You must use
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.InsertEntity" title="pyslet.odata2.csdl.EntityCollection.InsertEntity"><tt class="xref py py-meth docutils literal"><span class="pre">InsertEntity()</span></tt></a> instead where the reasons for this
restriction are expanded on.</p>
<p>For consistency with python dictionaries the following statement is
permitted, though it is effectively a no-operation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">etColl</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">=</span><span class="n">entity</span>
</pre></div>
</div>
<p>The above statement raises KeyError if <em>entity</em> is <em>not</em> a member of
the entity set.  If <em>key</em> does not match the entity&#8217;s key then
ValueError is raised.</p>
<p>Although you can&#8217;t add an entity with assignment you can delete an
entity with the delete operator:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">del</span> <span class="n">etColl</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
</pre></div>
</div>
<p>Deletes the entity with <em>key</em> from the entity set.</p>
<p>These two operations have a different meaning when a collection
represents the subset of entities obtained through navigation.  See
<a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection" title="pyslet.odata2.csdl.NavigationCollection"><tt class="xref py py-class docutils literal"><span class="pre">NavigationCollection</span></tt></a> for details.</p>
<p><em>Notes for data providers</em></p>
<p>Derived classes MUST call super in their __init__ method to ensure
the proper construction of the parent collection class.  The proper
way to do this is:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">MyCollection</span><span class="p">(</span><span class="n">EntityCollection</span><span class="p">):</span>

        <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">paramA</span><span class="p">,</span><span class="n">paramsB</span><span class="p">,</span><span class="o">**</span><span class="n">kwArgs</span><span class="p">):</span>
                <span class="c"># paramA and paramB are examples of how to consume</span>
                <span class="c"># private keyword arguments in this method so that they</span>
                <span class="c"># aren&#39;t passed on to the next __init__</span>
                <span class="nb">super</span><span class="p">(</span><span class="n">MyCollection</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwArgs</span><span class="p">)</span>
</pre></div>
</div>
<p>All collections require a named entitySet argument, an
<a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a> instance from which all entities in the
collection are drawn.</p>
<p>Derived classes MUST also override <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.itervalues" title="pyslet.odata2.csdl.EntityCollection.itervalues"><tt class="xref py py-meth docutils literal"><span class="pre">itervalues()</span></tt></a>.  The
implementation of itervalues must return an iterable object that
honours the value of the expand query option, the current filter and
the orderby rules.</p>
<p>Derived classes SHOULD also override <tt class="xref py py-meth docutils literal"><span class="pre">__getitem__()</span></tt> and
<tt class="xref py py-meth docutils literal"><span class="pre">__len__()</span></tt> as the default implementations are very
inefficient, particularly for non-trivial entity sets.</p>
<p>Writeable data sources must override py:meth:<cite>__delitem__</cite>.</p>
<p>If a particular operation is not supported for some data-service
specific reason then NotImplementedError must be raised.</p>
<p>Writeable entity collections SHOULD override <tt class="xref py py-meth docutils literal"><span class="pre">clear()</span></tt> as the
default implementation is very inefficient.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.entitySet">
<tt class="descname">entitySet</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.entitySet" title="Permalink to this definition">¶</a></dt>
<dd><p>the entity set from which the entities are drawn</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.entitySet" title="pyslet.odata2.csdl.EntityCollection.entitySet"><tt class="xref py py-attr docutils literal"><span class="pre">entitySet</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.expand">
<tt class="descname">expand</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.expand" title="Permalink to this definition">¶</a></dt>
<dd><p>the expand query option in effect</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.select">
<tt class="descname">select</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.select" title="Permalink to this definition">¶</a></dt>
<dd><p>the select query option in effect</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.filter">
<tt class="descname">filter</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.filter" title="Permalink to this definition">¶</a></dt>
<dd><p>a filter or None for no filter (see <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.CheckFilter" title="pyslet.odata2.csdl.EntityCollection.CheckFilter"><tt class="xref py py-meth docutils literal"><span class="pre">CheckFilter()</span></tt></a>)</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.orderby">
<tt class="descname">orderby</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.orderby" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of orderby rules or None for no ordering</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.skip">
<tt class="descname">skip</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.skip" title="Permalink to this definition">¶</a></dt>
<dd><p>the skip query option in effect</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.top">
<tt class="descname">top</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.top" title="Permalink to this definition">¶</a></dt>
<dd><p>the top query option in effect</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.topmax">
<tt class="descname">topmax</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.topmax" title="Permalink to this definition">¶</a></dt>
<dd><p>the provider-enforced maximum page size in effect</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityCollection.inlineCount">
<tt class="descname">inlineCount</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.inlineCount" title="Permalink to this definition">¶</a></dt>
<dd><p>True if inlineCount option is in effect</p>
<p>The inlineCount option is used to alter the representation of
the collection and, if set, indicates that the __len__ method
will be called before iterating through the collection itself.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.GetLocation">
<tt class="descname">GetLocation</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.GetLocation" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the location of this collection as a
<a class="reference internal" href="rfc2396.html#pyslet.rfc2396.URI" title="pyslet.rfc2396.URI"><tt class="xref py py-class docutils literal"><span class="pre">URI</span></tt></a> instance.</p>
<p>By default, the location is given as the location of the
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.entitySet" title="pyslet.odata2.csdl.EntityCollection.entitySet"><tt class="xref py py-attr docutils literal"><span class="pre">entitySet</span></tt></a> from which the entities are drawn.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.GetTitle">
<tt class="descname">GetTitle</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.GetTitle" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a user recognisable title for the collection.</p>
<p>By default this is the fully qualified name of the entity set
in the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.Expand">
<tt class="descname">Expand</tt><big>(</big><em>expand</em>, <em>select=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.Expand" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the expand and select query options for this collection.</p>
<p>The expand query option causes the named navigation properties
to be expanded and the associated entities to be loaded in to
the entity instances before they are returned by this collection.</p>
<p><em>expand</em> is a dictionary of expand rules.  Expansions can be chained,
represented by the dictionary entry also being a dictionary:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># expand the Customer navigation property...</span>
<span class="p">{</span> <span class="s">&#39;Customer&#39;</span><span class="p">:</span> <span class="bp">None</span> <span class="p">}</span>
<span class="c"># expand the Customer and Invoice navigation properties</span>
<span class="p">{</span> <span class="s">&#39;Customer&#39;</span><span class="p">:</span><span class="bp">None</span><span class="p">,</span> <span class="s">&#39;Invoice&#39;</span><span class="p">:</span><span class="bp">None</span> <span class="p">}</span>
<span class="c"># expand the Customer property and then the Orders property within Customer</span>
<span class="p">{</span> <span class="s">&#39;Customer&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s">&#39;Orders&#39;</span><span class="p">:</span><span class="bp">None</span><span class="p">}</span> <span class="p">}</span>
</pre></div>
</div>
<p>The select query option restricts the properties that are set in
returned entities.  The <em>select</em> option is a similar dictionary
structure, the main difference being that it can contain the
single key &#8216;*&#8217; indicating that all <em>data</em> properties are
selected.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.SelectKeys">
<tt class="descname">SelectKeys</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.SelectKeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the select rule to select the key property/properties only.</p>
<p>Any expand rule is removed.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.ExpandEntities">
<tt class="descname">ExpandEntities</tt><big>(</big><em>entityIterable</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.ExpandEntities" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility method for data providers.</p>
<p>Given an object that iterates over all entities in the
collection, returns a generator function that returns expanded
entities with select rules applied according to
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.expand" title="pyslet.odata2.csdl.EntityCollection.expand"><tt class="xref py py-attr docutils literal"><span class="pre">expand</span></tt></a> and <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.select" title="pyslet.odata2.csdl.EntityCollection.select"><tt class="xref py py-attr docutils literal"><span class="pre">select</span></tt></a> rules.</p>
<p>Data providers should use a better method of expanded entities
if possible as this implementation simply iterates through the
entities and calls <a class="reference internal" href="#pyslet.odata2.csdl.Entity.Expand" title="pyslet.odata2.csdl.Entity.Expand"><tt class="xref py py-meth docutils literal"><span class="pre">Entity.Expand()</span></tt></a> on each one.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.Filter">
<tt class="descname">Filter</tt><big>(</big><em>filter</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.Filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the filter object for this collection, see <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.CheckFilter" title="pyslet.odata2.csdl.EntityCollection.CheckFilter"><tt class="xref py py-meth docutils literal"><span class="pre">CheckFilter()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.FilterEntities">
<tt class="descname">FilterEntities</tt><big>(</big><em>entityIterable</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.FilterEntities" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility method for data providers.</p>
<p>Given an object that iterates over all entities in the
collection, returns a generator function that returns only those
entities that pass through the current <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.filter" title="pyslet.odata2.csdl.EntityCollection.filter"><tt class="xref py py-attr docutils literal"><span class="pre">filter</span></tt></a> object.</p>
<p>Data providers should use a better method of filtering entities
if possible as this implementation simply iterates through the
entities and calls <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.CheckFilter" title="pyslet.odata2.csdl.EntityCollection.CheckFilter"><tt class="xref py py-meth docutils literal"><span class="pre">CheckFilter()</span></tt></a> on each one.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.CheckFilter">
<tt class="descname">CheckFilter</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.CheckFilter" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks <em>entity</em> against the current filter object and returns
True if it passes.</p>
<p>This method is really a placeholder.  Filtering is not covered
in the CSDL model itself but is a feature of the OData
<a class="reference internal" href="odatav2_core.html#module-pyslet.odata2.core" title="pyslet.odata2.core"><tt class="xref py py-mod docutils literal"><span class="pre">pyslet.odata2.core</span></tt></a> module.</p>
<p>See
<tt class="xref py py-meth docutils literal"><span class="pre">pyslet.odata2.core.EntityCollectionMixin.CheckFilter()</span></tt>
for more.  The implementation in the case class simply raises
NotImplementedError if a filter has been set.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.OrderBy">
<tt class="descname">OrderBy</tt><big>(</big><em>orderby</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.OrderBy" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the orderby rules for this collection.</p>
<p><em>orderby</em> is a list of tuples, each consisting of:</p>
<div class="highlight-python"><div class="highlight"><pre>( an order object as used by :py:meth:`CalculateOrderKey` , 1 | -1 )
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.CalculateOrderKey">
<tt class="descname">CalculateOrderKey</tt><big>(</big><em>entity</em>, <em>orderObject</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.CalculateOrderKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Given an entity and an order object returns the key used to
sort the entity.</p>
<p>This method is really a placeholder.  Ordering is not covered
in the CSDL model itself but is a feature of the OData
<a class="reference internal" href="odatav2_core.html#module-pyslet.odata2.core" title="pyslet.odata2.core"><tt class="xref py py-mod docutils literal"><span class="pre">pyslet.odata2.core</span></tt></a> module.</p>
<p>See
<tt class="xref py py-meth docutils literal"><span class="pre">pyslet.odata2.core.EntityCollectionMixin.CalculateOrderKey()</span></tt>
for more.  The implementation in the case class simply raises
NotImplementedError.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.OrderEntities">
<tt class="descname">OrderEntities</tt><big>(</big><em>entityIterable</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.OrderEntities" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility method for data providers.</p>
<p>Given an object that iterates over the entities in random order,
returns a generator function that returns the same entities in
sorted order (according to the <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.orderby" title="pyslet.odata2.csdl.EntityCollection.orderby"><tt class="xref py py-attr docutils literal"><span class="pre">orderby</span></tt></a> object).</p>
<p>This implementation simply creates a list and then sorts it
based on the output of <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.CalculateOrderKey" title="pyslet.odata2.csdl.EntityCollection.CalculateOrderKey"><tt class="xref py py-meth docutils literal"><span class="pre">CalculateOrderKey()</span></tt></a> so is not
suitable for use with long lists of entities.  However, if no
ordering is required then no list is created.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.SetInlineCount">
<tt class="descname">SetInlineCount</tt><big>(</big><em>inlineCount</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.SetInlineCount" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the inline count flag for this collection.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.NewEntity">
<tt class="descname">NewEntity</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.NewEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a new py:class:<cite>Entity</cite> instance suitable for adding
to this collection.</p>
<p>The properties of the entity are set to their defaults, or to
null if no default is defined (even if the property is marked
as not nullable).</p>
<p>The entity is not considered to exist until it is actually added
to the collection.  At this point we deviate from
dictionary-like behaviour, Instead of using assignment you must
call <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.InsertEntity" title="pyslet.odata2.csdl.EntityCollection.InsertEntity"><tt class="xref py py-meth docutils literal"><span class="pre">InsertEntity()</span></tt></a>.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">e</span><span class="o">=</span><span class="n">collection</span><span class="o">.</span><span class="n">NewEntity</span><span class="p">()</span>
<span class="n">e</span><span class="p">[</span><span class="s">&quot;ID&quot;</span><span class="p">]</span><span class="o">=</span><span class="mi">1000</span>
<span class="n">e</span><span class="p">[</span><span class="s">&quot;Name&quot;</span><span class="p">]</span><span class="o">=</span><span class="s">&quot;Fred&quot;</span>
<span class="k">assert</span> <span class="mi">1000</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">collection</span>
<span class="n">collection</span><span class="p">[</span><span class="mi">1000</span><span class="p">]</span><span class="o">=</span><span class="n">e</span>                      <span class="c"># raises KeyError</span>
</pre></div>
</div>
<p>The correct way to add the entity is:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">collection</span><span class="o">.</span><span class="n">InsertEntity</span><span class="p">(</span><span class="n">e</span><span class="p">)</span>
</pre></div>
</div>
<p>The first block of code is prone to problems as the key 1000 may
violate the collection&#8217;s key allocation policy so we raise
KeyError when assignment is used to insert a new entity to the
collection. This is consistent with the concept behind OData and
Atom where new entities are POSTed to collections and the ID and
resulting entity are returned to the caller on success because
the service may have modified them to satisfy service-specific
constraints.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.CopyEntity">
<tt class="descname">CopyEntity</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.CopyEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a new <em>entity</em> copying the value from <em>entity</em></p>
<p>The key is not copied and is initially set to NULL.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.InsertEntity">
<tt class="descname">InsertEntity</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.InsertEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Inserts <em>entity</em> into this entity set.</p>
<p>After a successful call to InsertEntity:</p>
<ol class="arabic simple">
<li><em>entity</em> is updated with any auto-generated values such as
an autoincrement correct key.</li>
<li><tt class="xref py py-attr docutils literal"><span class="pre">exists</span></tt> is set to True for <em>entity</em></li>
</ol>
<p>Data providers must override this method if the collection is
writeable.</p>
<p>If the call is unsuccessful then <em>entity</em> should be discarded as
its associated bindings may be in a misleading state (when
compared to the state of the data source itself).</p>
<p>A general <a class="reference internal" href="#pyslet.odata2.csdl.ConstraintError" title="pyslet.odata2.csdl.ConstraintError"><tt class="xref py py-class docutils literal"><span class="pre">ConstraintError</span></tt></a> will be raised when the
insertion violates model constraints (including an attempt to
create two entities with duplicate keys).</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.UpdateEntity">
<tt class="descname">UpdateEntity</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.UpdateEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates <em>entity</em> which must already be in the entity set.</p>
<p>Data providers must override this method if the collection is
writeable.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.UpdateBindings">
<tt class="descname">UpdateBindings</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.UpdateBindings" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates through the <a class="reference internal" href="#pyslet.odata2.csdl.Entity.NavigationItems" title="pyslet.odata2.csdl.Entity.NavigationItems"><tt class="xref py py-meth docutils literal"><span class="pre">Entity.NavigationItems()</span></tt></a> and
generates appropriate calls to create/update any pending
bindings.</p>
<p>Unlike the <tt class="xref py py-meth docutils literal"><span class="pre">Update()</span></tt> method, which updates all data and
navigation values simultaneously, this method can be used to
selectively update just the navigation properties.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.SetPage">
<tt class="descname">SetPage</tt><big>(</big><em>top</em>, <em>skip=0</em>, <em>skiptoken=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.SetPage" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the page parameters that determine the next page
returned by <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.iterpage" title="pyslet.odata2.csdl.EntityCollection.iterpage"><tt class="xref py py-meth docutils literal"><span class="pre">iterpage()</span></tt></a>.</p>
<p>The skip and top query options are integers which determine the
number of entities returned (top) and the number of entities
skipped (skip).</p>
<p><em>skiptoken</em> is an opaque token previously obtained from a call
to <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.NextSkipToken" title="pyslet.odata2.csdl.EntityCollection.NextSkipToken"><tt class="xref py py-meth docutils literal"><span class="pre">NextSkipToken()</span></tt></a> on a similar collection which
provides an index into collection prior to any additional <em>skip</em>
being applied.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.TopMax">
<tt class="descname">TopMax</tt><big>(</big><em>topmax</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.TopMax" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the maximum page size for this collection.</p>
<p>Data consumers should use <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.SetPage" title="pyslet.odata2.csdl.EntityCollection.SetPage"><tt class="xref py py-meth docutils literal"><span class="pre">SetPage()</span></tt></a> to control paging,
however data providers can use this method to force the
collection to limit the size of a page to at most topmax
entities.  When topmax is in force and is less than the top
value set in <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.SetPage" title="pyslet.odata2.csdl.EntityCollection.SetPage"><tt class="xref py py-meth docutils literal"><span class="pre">SetPage()</span></tt></a>,
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.NextSkipToken" title="pyslet.odata2.csdl.EntityCollection.NextSkipToken"><tt class="xref py py-meth docutils literal"><span class="pre">NextSkipToken()</span></tt></a> will return a suitable value for
identifying the next page in the collection immediately after a
complete iteration of <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.iterpage" title="pyslet.odata2.csdl.EntityCollection.iterpage"><tt class="xref py py-meth docutils literal"><span class="pre">iterpage()</span></tt></a>.</p>
<p>Provider enforced paging is optional, if it is not supported
NotImplementedError must be raised.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.iterpage">
<tt class="descname">iterpage</tt><big>(</big><em>setNextPage=False</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.iterpage" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterable subset of the values returned by
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.itervalues" title="pyslet.odata2.csdl.EntityCollection.itervalues"><tt class="xref py py-meth docutils literal"><span class="pre">itervalues()</span></tt></a></p>
<p>The subset is defined by the top, skip and skiptoken values set
with <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.SetPage" title="pyslet.odata2.csdl.EntityCollection.SetPage"><tt class="xref py py-meth docutils literal"><span class="pre">SetPage()</span></tt></a></p>
<p>If <em>setNextPage</em> is True then the page is automatically advanced
so that the next call to iterpage iterates over the next page.</p>
<p>Data providers should override this implementation for a more
efficient implementation.  The default implementation simply
wraps <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.itervalues" title="pyslet.odata2.csdl.EntityCollection.itervalues"><tt class="xref py py-meth docutils literal"><span class="pre">itervalues()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.NextSkipToken">
<tt class="descname">NextSkipToken</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.NextSkipToken" title="Permalink to this definition">¶</a></dt>
<dd><p>Following a complete iteration of the generator returned by
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.iterpage" title="pyslet.odata2.csdl.EntityCollection.iterpage"><tt class="xref py py-meth docutils literal"><span class="pre">iterpage()</span></tt></a>, this method returns the skiptoken which
will generate the next page or None if all requested entities
were returned.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityCollection.itervalues">
<tt class="descname">itervalues</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityCollection.itervalues" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates over the collection.</p>
<p>The collection is filtered as defined by <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.Filter" title="pyslet.odata2.csdl.EntityCollection.Filter"><tt class="xref py py-meth docutils literal"><span class="pre">Filter()</span></tt></a> and
sorted according to any rules defined by <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.OrderBy" title="pyslet.odata2.csdl.EntityCollection.OrderBy"><tt class="xref py py-meth docutils literal"><span class="pre">OrderBy()</span></tt></a>.</p>
<p>Entities are also expanded and selected according to the rules
defined by <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.Expand" title="pyslet.odata2.csdl.EntityCollection.Expand"><tt class="xref py py-class docutils literal"><span class="pre">Expand</span></tt></a>.</p>
<p>Data providers must override this implementation which, by
default, returns no entities (simulating an empty collection).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Entity">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Entity</tt><big>(</big><em>entitySet</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.TypeInstance" title="pyslet.odata2.csdl.TypeInstance"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.TypeInstance</span></tt></a></p>
<p>Represents a single instance of an <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a>.</p>
<p>Entity instance must only be created by data providers, a child
class may be used with data provider-specific functionality.  Data
consumers should use the <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.NewEntity" title="pyslet.odata2.csdl.EntityCollection.NewEntity"><tt class="xref py py-meth docutils literal"><span class="pre">EntityCollection.NewEntity()</span></tt></a> or
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.CopyEntity" title="pyslet.odata2.csdl.EntityCollection.CopyEntity"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection.CopyEntity</span></tt></a> methods to create instances.</p>
<ul class="simple">
<li>entitySet is the entity set this entity belongs to</li>
</ul>
<p>Entity instances extend <a class="reference internal" href="#pyslet.odata2.csdl.TypeInstance" title="pyslet.odata2.csdl.TypeInstance"><tt class="xref py py-class docutils literal"><span class="pre">TypeInstance</span></tt></a>&#8216;s dictionary-like
behaviour to include all properties.  As a result the dictionary
values are one of <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.Complex" title="pyslet.odata2.csdl.Complex"><tt class="xref py py-class docutils literal"><span class="pre">Complex</span></tt></a> or
py:class:<cite>DeferredValue</cite> instances.</p>
<p>Property values are created on construction and cannot be assigned
directly. To update a simple value use the value&#8217;s
<tt class="xref py py-meth docutils literal"><span class="pre">SimpleValue.SetFromPyVaue()</span></tt> method:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">e</span><span class="p">[</span><span class="s">&#39;Name&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">SetFromValue</span><span class="p">(</span><span class="s">&quot;Steve&quot;</span><span class="p">)</span>
        <span class="c"># update simple property Name</span>
<span class="n">e</span><span class="p">[</span><span class="s">&#39;Address&#39;</span><span class="p">][</span><span class="s">&#39;City&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">SetFromValue</span><span class="p">(</span><span class="s">&quot;Cambridge&quot;</span><span class="p">)</span>
        <span class="c"># update City in complex property Address</span>
</pre></div>
</div>
<p>A simple valued property that is NULL is still a
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instance, though it will behave as
0 in tests:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">e</span><span class="p">[</span><span class="s">&#39;Name&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">SetFromValue</span><span class="p">(</span><span class="bp">None</span><span class="p">)</span>    <span class="c"># set to NULL</span>
<span class="k">if</span> <span class="n">e</span><span class="p">[</span><span class="s">&#39;Name&#39;</span><span class="p">]:</span>
        <span class="k">print</span> <span class="s">&quot;Will not print!&quot;</span>
</pre></div>
</div>
<p>Navigation properties are represented as <a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue" title="pyslet.odata2.csdl.DeferredValue"><tt class="xref py py-class docutils literal"><span class="pre">DeferredValue</span></tt></a>
instances.  A deferred value can be opened in a similar way to an
entity set:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># open the collection obtained from navigation property Friends</span>
<span class="k">with</span> <span class="n">e</span><span class="p">[</span><span class="s">&#39;Friends&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">OpenCollection</span><span class="p">()</span> <span class="k">as</span> <span class="n">friends</span><span class="p">:</span>
        <span class="c"># iterate through all the friends of entity e </span>
        <span class="k">for</span> <span class="n">friend</span> <span class="ow">in</span> <span class="n">friends</span><span class="p">:</span>
                <span class="k">print</span> <span class="n">friend</span><span class="p">[</span><span class="s">&#39;Name&#39;</span><span class="p">]</span>
</pre></div>
</div>
<p>A convenience method is provided when the navigation property points
to a single entity (or None) by definition:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">mum</span><span class="o">=</span><span class="n">e</span><span class="p">[</span><span class="s">&#39;Mother&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">GetEntity</span><span class="p">()</span>             <span class="c"># may return None</span>
</pre></div>
</div>
<p>In the EDM one or more properties are marked as forming the entity&#8217;s
key.  The entity key is unique within the entity set.  On
construction, an Entity instance is marked as being &#8216;non-existent&#8217;,
<a class="reference internal" href="#pyslet.odata2.csdl.Entity.exists" title="pyslet.odata2.csdl.Entity.exists"><tt class="xref py py-attr docutils literal"><span class="pre">exists</span></tt></a> is set to False.  This is consistent with the fact
that the data properties of an entity are initialised to their
default values, or NULL if there is no default specified in the
model. Entity instances returned as values in collection objects
have exists set to True.</p>
<p>If an entity does not exist, OpenCollection will fail if called on
one of its navigation properties with <a class="reference internal" href="#pyslet.odata2.csdl.NonExistentEntity" title="pyslet.odata2.csdl.NonExistentEntity"><tt class="xref py py-class docutils literal"><span class="pre">NonExistentEntity</span></tt></a>.</p>
<p>You can use <a class="reference internal" href="#pyslet.odata2.csdl.Entity.IsEntityCollection" title="pyslet.odata2.csdl.Entity.IsEntityCollection"><tt class="xref py py-meth docutils literal"><span class="pre">IsEntityCollection()</span></tt></a> to determine if a property
will return an <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a> without the cost of
accessing the data source itself.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Entity.exists">
<tt class="descname">exists</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Entity.exists" title="Permalink to this definition">¶</a></dt>
<dd><p>whether or not the instance exists in the entity set</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Entity.selected">
<tt class="descname">selected</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Entity.selected" title="Permalink to this definition">¶</a></dt>
<dd><p>the set of selected property names or None if all properties are selected</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.__iter__">
<tt class="descname">__iter__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.__iter__" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates over the property names, including the navigation
properties.</p>
<p>Unlike native Python dictionaries, the order in which the
properties are iterated over is defined.  The regular property
names are yielded first, followed by the navigation properties. 
Within these groups properties are yielded in the order they
were declared in the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.DataKeys">
<tt class="descname">DataKeys</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.DataKeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates through the names of this entity&#8217;s data properties only</p>
<p>The order of the names is always the order they are defined in
the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.DataItems">
<tt class="descname">DataItems</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.DataItems" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator that yields tuples of (key,value) for this entity&#8217;s
data properties only.</p>
<p>The order of the items is always the order they are defined in
the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.SetFromEntity">
<tt class="descname">SetFromEntity</tt><big>(</big><em>newValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.SetFromEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets this entity&#8217;s value from <em>newValue</em> which must be a
<a class="reference internal" href="#pyslet.odata2.csdl.TypeInstance" title="pyslet.odata2.csdl.TypeInstance"><tt class="xref py py-class docutils literal"><span class="pre">TypeInstance</span></tt></a> instance.  In other words, it may
be either an Entity or a Complex value.</p>
<p>There is no requirement that <em>newValue</em> be of the same type,
but it must be broadly compatible, which is defined as:</p>
<blockquote>
<div>Any named property present in both the current value and
<em>newValue</em> must be of compatible types.</div></blockquote>
<p>Any named property in the current value which is not present in
<em>newValue</em> is left unchanged by this method.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.NavigationKeys">
<tt class="descname">NavigationKeys</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.NavigationKeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates through the names of this entity&#8217;s navigation properties only.</p>
<p>The order of the names is always the order they are defined in
the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.NavigationItems">
<tt class="descname">NavigationItems</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.NavigationItems" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator that yields tuples of (key,deferred value) for this
entity&#8217;s navigation properties only.</p>
<p>The order of the items is always the order they are defined in
the metadata model.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.CheckNavigationConstraints">
<tt class="descname">CheckNavigationConstraints</tt><big>(</big><em>ignoreEnd=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.CheckNavigationConstraints" title="Permalink to this definition">¶</a></dt>
<dd><p>For entities that do not yet exist, checks that each of the
required navigation properties has been bound (with
<a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue.BindEntity" title="pyslet.odata2.csdl.DeferredValue.BindEntity"><tt class="xref py py-meth docutils literal"><span class="pre">DeferredValue.BindEntity()</span></tt></a>).</p>
<p>If a required navigation property has not been bound then
<tt class="xref py py-class docutils literal"><span class="pre">NavigationConstraintError</span></tt> is raised.</p>
<p>If the entity already exists, <a class="reference internal" href="#pyslet.odata2.csdl.EntityExists" title="pyslet.odata2.csdl.EntityExists"><tt class="xref py py-class docutils literal"><span class="pre">EntityExists</span></tt></a> is
raised.</p>
<p>For data providers, <em>ignoreEnd</em> may be set to an
associationSetEnd bound to this entity&#8217;s entity set.  Any
violation of the related association is ignored.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.IsNavigationProperty">
<tt class="descname">IsNavigationProperty</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.IsNavigationProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if name is the name of a navigation property,
False otherwise.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.IsEntityCollection">
<tt class="descname">IsEntityCollection</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.IsEntityCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <em>name</em> is the name of a navigation property
that points to an entity collection, False otherwise.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.Update">
<tt class="descname">Update</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.Update" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates this entity following modification.</p>
<p>You can use select rules to provide a hint about which fields
have been updated.  By the same logic, you cannot update a
property that is not selected!</p>
<p>The default implementation opens a collection object from the
parent entity set and calls
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.UpdateEntity" title="pyslet.odata2.csdl.EntityCollection.UpdateEntity"><tt class="xref py py-meth docutils literal"><span class="pre">EntityCollection.UpdateEntity()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.Delete">
<tt class="descname">Delete</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.Delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Deletes this entity from the parent entity set.</p>
<p>The default implementation opens a collection object from the
parent entity set and uses the del operator.</p>
<p>Data providers must ensure that the entity&#8217;s <a class="reference internal" href="#pyslet.odata2.csdl.Entity.exists" title="pyslet.odata2.csdl.Entity.exists"><tt class="xref py py-attr docutils literal"><span class="pre">exists</span></tt></a>
flag is set to False after deletion.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.Key">
<tt class="descname">Key</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.Key" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the entity key as a single python value or a tuple of
python values for compound keys.</p>
<p>The order of the values is always the order of the PropertyRef
definitions in the associated EntityType&#8217;s <a class="reference internal" href="#pyslet.odata2.csdl.Key" title="pyslet.odata2.csdl.Key"><tt class="xref py py-class docutils literal"><span class="pre">Key</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.SetKey">
<tt class="descname">SetKey</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.SetKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets this entity&#8217;s key from a single python value or tuple.</p>
<p>The entity must be non-existent or <a class="reference internal" href="#pyslet.odata2.csdl.EntityExists" title="pyslet.odata2.csdl.EntityExists"><tt class="xref py py-class docutils literal"><span class="pre">EntityExists</span></tt></a> is raised.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.KeyDict">
<tt class="descname">KeyDict</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.KeyDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the entity key as a dictionary mapping key property
names onto <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instances.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.Expand">
<tt class="descname">Expand</tt><big>(</big><em>expand</em>, <em>select=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.Expand" title="Permalink to this definition">¶</a></dt>
<dd><p>Expands and selects properties of the entity according to the
given <em>expand</em> and <em>select</em> rules (if any).</p>
<p>Data consumers will usually apply expand rules to a collection
which will then automatically ensure that all entities returned
by the collection have been expanded.</p>
<p>If, as a result of <em>select</em>, a non-key property is unselected
then its value is set to NULL.  (Properties that comprise the
key are never NULL.)</p>
<p>If a property that is being expanded is also subject to one or
more selection rules these are passed along with any chained
Expand method call.</p>
<p>The selection rules in effect are saved in the <tt class="xref py py-attr docutils literal"><span class="pre">select</span></tt>
member and can be tested using <a class="reference internal" href="#pyslet.odata2.csdl.Entity.Selected" title="pyslet.odata2.csdl.Entity.Selected"><tt class="xref py py-meth docutils literal"><span class="pre">Selected()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.Selected">
<tt class="descname">Selected</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.Selected" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if the property <em>name</em> is selected in this entity.</p>
<p>You should not rely on the value of a unselected property, in most
cases it will be set to NULL.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.ETag">
<tt class="descname">ETag</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.ETag" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of EDMValue instance values to use for optimistic
concurrency control or None if the entity does not support it (or if
all concurrency tokens are NULL or unselected).</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.ETagValues">
<tt class="descname">ETagValues</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.ETagValues" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of EDMValue instance values that may be used
for optimistic concurrency control.  The difference between this
method and <a class="reference internal" href="#pyslet.odata2.csdl.Entity.ETag" title="pyslet.odata2.csdl.Entity.ETag"><tt class="xref py py-meth docutils literal"><span class="pre">ETag()</span></tt></a> is that this method returns all
values even if they are NULL or unselected.  If there are no
concurrency tokens then an empty list is returned.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.GenerateConcurrencyHash">
<tt class="descname">GenerateConcurrencyHash</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.GenerateConcurrencyHash" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a hash object representing this entity&#8217;s value.</p>
<p>The hash is a SHA256 obtained by concatenating the literal
representations of all data properties (strings are UTF-8
encoded) except the keys and properties which have Fixed
concurrency mode.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.SetConcurrencyTokens">
<tt class="descname">SetConcurrencyTokens</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.SetConcurrencyTokens" title="Permalink to this definition">¶</a></dt>
<dd><p>A utility method for data providers.</p>
<p>Sets all <a class="reference internal" href="#pyslet.odata2.csdl.Entity.ETagValues" title="pyslet.odata2.csdl.Entity.ETagValues"><tt class="xref py py-meth docutils literal"><span class="pre">ETagValues()</span></tt></a> using the following algorithm:</p>
<ol class="arabic simple">
<li>Binary values are set directly from the output of
<a class="reference internal" href="#pyslet.odata2.csdl.Entity.GenerateConcurrencyHash" title="pyslet.odata2.csdl.Entity.GenerateConcurrencyHash"><tt class="xref py py-meth docutils literal"><span class="pre">GenerateConcurrencyHash()</span></tt></a></li>
<li>String values are set from the hexdigest of the output
<a class="reference internal" href="#pyslet.odata2.csdl.Entity.GenerateConcurrencyHash" title="pyslet.odata2.csdl.Entity.GenerateConcurrencyHash"><tt class="xref py py-meth docutils literal"><span class="pre">GenerateConcurrencyHash()</span></tt></a></li>
<li>Integer values are incremented.</li>
<li>DateTime and DateTimeOffset values are set to the current
time in UTC (and nudged by 1s if necessary)</li>
<li>Guid values are set to a new random (type 4) UUID.</li>
</ol>
<p>Any other type will generate a ValueError.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Entity.ETagIsStrong">
<tt class="descname">ETagIsStrong</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Entity.ETagIsStrong" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if this entity&#8217;s etag is a strong entity tag as defined
by RFC2616:</p>
<div class="highlight-python"><div class="highlight"><pre>A &quot;strong entity tag&quot; MAY be shared by two entities of a
resource only if they are equivalent by octet equality.
</pre></div>
</div>
<p>The default implementation returns False which is consistent
with the implementation of <a class="reference internal" href="#pyslet.odata2.csdl.Entity.GenerateConcurrencyHash" title="pyslet.odata2.csdl.Entity.GenerateConcurrencyHash"><tt class="xref py py-meth docutils literal"><span class="pre">GenerateConcurrencyHash()</span></tt></a>
as that does not include the key fields.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.SimpleValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">SimpleValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMValue</span></tt></a></p>
<p>An abstract class that represents a value of a simple type in the EDMModel.</p>
<p>This class is not designed to be instantiated directly, use one of
the factory methods in <tt class="xref py py-class docutils literal"><span class="pre">EdmValue</span></tt> to construct one of the
specific child classes.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.SimpleValue.typeCode">
<tt class="descname">typeCode</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.typeCode" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.SimpleType" title="pyslet.odata2.csdl.SimpleType"><tt class="xref py py-class docutils literal"><span class="pre">SimpleType</span></tt></a> code</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.SimpleValue.mType">
<tt class="descname">mType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.mType" title="Permalink to this definition">¶</a></dt>
<dd><p>an optional <a class="reference internal" href="rfc2616.html#pyslet.rfc2616.MediaType" title="pyslet.rfc2616.MediaType"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.rfc2616.MediaType</span></tt></a> representing this value</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.SimpleValue.value">
<tt class="descname">value</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.value" title="Permalink to this definition">¶</a></dt>
<dd><p>The actual value or None if this instance represents a NULL value</p>
<p>The python type used for <em>value</em> depends on typeCode as follows:</p>
<ul class="simple">
<li>Edm.Boolean: one of the Python constants True or False</li>
<li>Edm.Byte, Edm.SByte, Edm.Int16, Edm.Int32: int</li>
<li>Edm.Int64: long</li>
<li>Edm.Double, Edm.Single: python float</li>
<li>Edm.Decimal: python Decimal instance (from decimal module)</li>
<li>Edm.DateTime, Edm.DateTimeOffset: py:class:<cite>pyslet.iso8601.TimePoint</cite> instance</li>
<li>Edm.Time:     py:class:<cite>pyslet.iso8601.Time</cite> instance (not a Duration, note corrected v2 specification of OData)</li>
<li>Edm.Binary: raw string</li>
<li>Edm.String: unicode string</li>
<li>Edm.Guid: python UUID instance (from uuid module)</li>
</ul>
<p>For future compatibility, this attribute should only be updated
using
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue.SetFromValue" title="pyslet.odata2.csdl.SimpleValue.SetFromValue"><tt class="xref py py-meth docutils literal"><span class="pre">SetFromValue()</span></tt></a> or one of the other related methods.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.SimpleCast">
<tt class="descname">SimpleCast</tt><big>(</big><em>typeCode</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.SimpleCast" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a new <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instance created from <em>typeCode</em></p>
<p>The value of the new instance is set using <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue.Cast" title="pyslet.odata2.csdl.SimpleValue.Cast"><tt class="xref py py-meth docutils literal"><span class="pre">Cast()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.Cast">
<tt class="descname">Cast</tt><big>(</big><em>targetValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.Cast" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates and returns <em>targetValue</em> a <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instance.</p>
<p>The value of targetValue is replaced with a value cast from this
instance&#8217;s value.</p>
<p>If the types are incompatible a TypeError is raised, if the
values are incompatible then ValueError is raised.</p>
<p>NULL values can be cast to any value type.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.SetFromSimpleValue">
<tt class="descname">SetFromSimpleValue</tt><big>(</big><em>newValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.SetFromSimpleValue" title="Permalink to this definition">¶</a></dt>
<dd><p>The reverse of the <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue.Cast" title="pyslet.odata2.csdl.SimpleValue.Cast"><tt class="xref py py-meth docutils literal"><span class="pre">Cast()</span></tt></a> method, sets this value to
the value of <em>newValue</em> casting as appropriate.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.__eq__">
<tt class="descname">__eq__</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Instances compare equal only if they of the same type and
have values that compare equal.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.__unicode__">
<tt class="descname">__unicode__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.__unicode__" title="Permalink to this definition">¶</a></dt>
<dd><p>Formats this value into its literal form.</p>
<p>NULL values cannot be represented in literal form and will raise
ValueError.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.SetFromLiteral">
<tt class="descname">SetFromLiteral</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.SetFromLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes a value from the value&#8217;s literal form.</p>
<p>You can get the literal form of a value using the unicode function.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.SetNull">
<tt class="descname">SetNull</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.SetNull" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the value to NULL</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SimpleValue.SetFromValue">
<tt class="descname">SetFromValue</tt><big>(</big><em>newValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.SetFromValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the value from a python variable coercing <em>newValue</em> if
necessary to ensure it is of the correct type for the value&#8217;s
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue.typeCode" title="pyslet.odata2.csdl.SimpleValue.typeCode"><tt class="xref py py-attr docutils literal"><span class="pre">typeCode</span></tt></a>.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyslet.odata2.csdl.SimpleValue.Copy">
<em class="property">classmethod </em><tt class="descname">Copy</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SimpleValue.Copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a new SimpleValue instance by copying <em>value</em></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.NumericValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NumericValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NumericValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>An abstract class that represents all numeric simple values.</p>
<p>The literal forms of numeric values are parsed in a two-stage
process.  Firstly the utility class <a class="reference internal" href="#pyslet.odata2.csdl.Parser" title="pyslet.odata2.csdl.Parser"><tt class="xref py py-class docutils literal"><span class="pre">Parser</span></tt></a> is used to
obtain a numeric tuple and then the value is set using
<a class="reference internal" href="#pyslet.odata2.csdl.NumericValue.SetFromNumericLiteral" title="pyslet.odata2.csdl.NumericValue.SetFromNumericLiteral"><tt class="xref py py-meth docutils literal"><span class="pre">SetFromNumericLiteral()</span></tt></a></p>
<p>All numeric types may have their value set directly from int, long,
float or Decimal.</p>
<p>Integer representations are rounded towards zero using the python
<em>int</em> or <em>long</em> functions when necessary.</p>
<dl class="method">
<dt id="pyslet.odata2.csdl.NumericValue.SetToZero">
<tt class="descname">SetToZero</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NumericValue.SetToZero" title="Permalink to this definition">¶</a></dt>
<dd><p>Set this value to the default representation of zero</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NumericValue.SetFromNumericLiteral">
<tt class="descname">SetFromNumericLiteral</tt><big>(</big><em>numericValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NumericValue.SetFromNumericLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes a value from a numeric tuple as returned by
<a class="reference internal" href="#pyslet.odata2.csdl.Parser.ParseNumericLiteral" title="pyslet.odata2.csdl.Parser.ParseNumericLiteral"><tt class="xref py py-meth docutils literal"><span class="pre">Parser.ParseNumericLiteral()</span></tt></a>.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.FloatValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">FloatValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.FloatValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Abstract class that represents one of Edm.Double or Edm.Single.</p>
<p>Values can be set from int, long, float or Decimal.</p>
<p>There is no hard-and-fast rule about the representation of float in
Python and we may refuse to accept values that fall within the
accepted ranges defined by the CSDL if float cannot hold them.  That
said, you won&#8217;t have this problem in practice.</p>
<p>The derived classes <a class="reference internal" href="#pyslet.odata2.csdl.SingleValue" title="pyslet.odata2.csdl.SingleValue"><tt class="xref py py-class docutils literal"><span class="pre">SingleValue</span></tt></a> and
<a class="reference internal" href="#pyslet.odata2.csdl.DoubleValue" title="pyslet.odata2.csdl.DoubleValue"><tt class="xref py py-class docutils literal"><span class="pre">DoubleValue</span></tt></a> only differ in the Max value used
when range checking.</p>
<p>Values are formatted using Python&#8217;s default unicode conversion.</p>
</dd></dl>

<div class="section" id="primitive-simpletypes">
<h3>2.1.3.1.1.1. Primitive SimpleTypes<a class="headerlink" href="#primitive-simpletypes" title="Permalink to this headline">¶</a></h3>
<p>Simple values can be created directly using one of the type-specific
classes below.</p>
<dl class="class">
<dt id="pyslet.odata2.csdl.BinaryValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">BinaryValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.BinaryValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> of type Edm.Binary.</p>
<p>Binary literals allow content in the following form:</p>
<div class="highlight-python"><div class="highlight"><pre>[A-Fa-f0-9][A-Fa-f0-9]*
</pre></div>
</div>
<p>Binary values can be set from any Python type, though anything other
than a binary string is set to its pickled representation.  There is
no reverse facility for reading an object from the pickled value.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.BooleanValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">BooleanValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.BooleanValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Boolean</p>
<p>Boolean literals are one of:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">true</span> <span class="o">|</span> <span class="n">false</span>
</pre></div>
</div>
<p>Boolean values can be set from their Python equivalents and from any
int, long, float or Decimal where the non-zero test is used to set
the value.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ByteValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ByteValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.ByteValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Byte</p>
<p>Byte literals must not have a sign, decimal point or exponent.</p>
<p>Byte values can be set from an int, long, float or Decimal</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DateTimeValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DateTimeValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DateTimeValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.DateTime</p>
<p>DateTime literals allow content in the following form:</p>
<div class="highlight-python"><div class="highlight"><pre>yyyy-mm-ddThh:mm[:ss[.fffffff]]
</pre></div>
</div>
<p>DateTime values can be set from an instance of
<tt class="xref py py-class docutils literal"><span class="pre">iso8601.TimePoint</span></tt> or type int, long, float or Decimal.</p>
<p>Any zone specifier is ignored.  There is <em>no</em> conversion to UTC, the
value simply becomes a local time in an unspecified zone.  This is a
weakness of the EDM, it is good practice to limit use of the
DateTime type to UTC times.</p>
<p>When set from a numeric value, the value must be non-negative.  Unix
time is assumed.  See the
<a class="reference internal" href="iso8601.html#pyslet.iso8601.TimePoint.FromUnixTime" title="pyslet.iso8601.TimePoint.FromUnixTime"><tt class="xref py py-meth docutils literal"><span class="pre">FromUnixTime()</span></tt></a> factory method of
TimePoint for information.</p>
<p>If a property definition was set on construction then the defined
precision is used when representing the value as a unicode string.
For example, if the property has precision 3 then the output of the
unicode conversion will appear in the following form:</p>
<div class="highlight-python"><div class="highlight"><pre>1969-07-20T20:17:40.000
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DateTimeOffsetValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DateTimeOffsetValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DateTimeOffsetValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.DateTimeOffset</p>
<p>DateTimeOffset literals are defined in terms of the XMLSchema
lexical representation.</p>
<p>DateTimeOffset values can be set from an instance of
<tt class="xref py py-class docutils literal"><span class="pre">iso8601.TimePoint</span></tt> or type int, long, float or Decimal.</p>
<p>TimePoint instances must have a zone specifier.  There is <em>no</em>
automatic assumption of UTC.</p>
<p>When set from a numeric value, the value must be non-negative.  Unix
time <em>in UTC</em> assumed.  See the
<a class="reference internal" href="iso8601.html#pyslet.iso8601.TimePoint.FromUnixTime" title="pyslet.iso8601.TimePoint.FromUnixTime"><tt class="xref py py-meth docutils literal"><span class="pre">FromUnixTime()</span></tt></a> factory method of
TimePoint for information.</p>
<p>If a property definition was set on construction then the defined
precision is used when representing the value as a unicode string.
For example, if the property has precision 3 then the output of the
unicode conversion will appear in the following form:</p>
<div class="highlight-python"><div class="highlight"><pre>1969-07-20T15:17:40.000-05:00
</pre></div>
</div>
<p>It isn&#8217;t completely clear if the canonical representation of UTC
using &#8216;Z&#8217; instead of an offset is intended or widely supported so we
always use an offset:</p>
<div class="highlight-python"><div class="highlight"><pre>1969-07-20T20:17:40.000+00:00
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DecimalValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DecimalValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DecimalValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Decimal</p>
<p>Decimal literals must not use exponent notation and there must be no
more than 29 digits to the left and right of the decimal point.</p>
<p>Decimal values can be set from int, long, float or Decimal values.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DoubleValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DoubleValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DoubleValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.FloatValue" title="pyslet.odata2.csdl.FloatValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.FloatValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Double</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.DoubleValue.Max">
<tt class="descname">Max</tt><em class="property"> = 1.7976931348623157e+308</em><a class="headerlink" href="#pyslet.odata2.csdl.DoubleValue.Max" title="Permalink to this definition">¶</a></dt>
<dd><p>the largest positive double value</p>
<p>This value is set dynamically on module load, theoretically it may
be set lower than the maximum allowed by the specification if
Python&#8217;s native float is of insufficient precision but this is
unlikely to be an issue.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.GuidValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">GuidValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.GuidValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Guid</p>
<p>Guid literals allow content in the following form:
dddddddd-dddd-dddd-dddd-dddddddddddd where each d represents [A-Fa-f0-9].</p>
<p>Guid values can also be set directly from either binary or hex
strings. Binary strings must be of length 16 and are passed as raw
bytes to the UUID constructor, hexadecimal strings can be string or
unicode strings and must be of length 32 characters.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Int16Value">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Int16Value</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Int16Value" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Int16</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Int32Value">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Int32Value</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Int32Value" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Int32</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Int64Value">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Int64Value</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Int64Value" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Int64</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.SByteValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">SByteValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SByteValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NumericValue" title="pyslet.odata2.csdl.NumericValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NumericValue</span></tt></a></p>
<p>Represents a simple value of type Edm.SByte</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.SingleValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">SingleValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SingleValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.FloatValue" title="pyslet.odata2.csdl.FloatValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.FloatValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Single</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.SingleValue.Max">
<tt class="descname">Max</tt><em class="property"> = 3.4028234663852886e+38</em><a class="headerlink" href="#pyslet.odata2.csdl.SingleValue.Max" title="Permalink to this definition">¶</a></dt>
<dd><p>the largest positive single value</p>
<p>This value is set dynamically on module load, theoretically it may
be set lower than the maximum allowed by the specification if
Python&#8217;s native float is of insufficient precision but this is very
unlikely to be an issue unless you&#8217;ve compiled Python on in a very
unusual environment.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.SingleValue.SetFromNumericLiteral">
<tt class="descname">SetFromNumericLiteral</tt><big>(</big><em>numericValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.SingleValue.SetFromNumericLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes a Single value from a <tt class="xref py py-class docutils literal"><span class="pre">Numeric</span></tt> literal.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.StringValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">StringValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.StringValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.String&#8221;</p>
<p>The literal form of a string is the string itself.</p>
<p>Values may be set from any string or object which supports the
native unicode function.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.TimeValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">TimeValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.TimeValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.SimpleValue</span></tt></a></p>
<p>Represents a simple value of type Edm.Time</p>
<p>Time literals allow content in the form:</p>
<blockquote>
<div>hh:mm:ss.sss</div></blockquote>
<p>Time values can be set from an instance of
<a class="reference internal" href="iso8601.html#pyslet.iso8601.Time" title="pyslet.iso8601.Time"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.iso8601.Time</span></tt></a>, int, long, float or
Decimal.</p>
<p>When set from a numeric value the value must be in the range
0..86399.9̅ and is treated as an elapsed time in seconds since
midnight.</p>
<p>If a property definition was set on construction then the defined
precision is used when representing the value as a unicode string.
For example, if the property has precision 3 then the output of the
unicode conversion will appear in the following form:</p>
<div class="highlight-python"><div class="highlight"><pre>20:17:40.000
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="complex-types">
<h3>2.1.3.1.1.2. Complex Types<a class="headerlink" href="#complex-types" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pyslet.odata2.csdl.Complex">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Complex</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Complex" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMValue</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.TypeInstance" title="pyslet.odata2.csdl.TypeInstance"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.TypeInstance</span></tt></a></p>
<p>Represents a single instance of a <a class="reference internal" href="#pyslet.odata2.csdl.ComplexType" title="pyslet.odata2.csdl.ComplexType"><tt class="xref py py-class docutils literal"><span class="pre">ComplexType</span></tt></a>.</p>
<dl class="method">
<dt id="pyslet.odata2.csdl.Complex.IsNull">
<tt class="descname">IsNull</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Complex.IsNull" title="Permalink to this definition">¶</a></dt>
<dd><p>Complex values are never NULL</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Complex.SetNull">
<tt class="descname">SetNull</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Complex.SetNull" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all simple property values to NULL recursively</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Complex.SetFromComplex">
<tt class="descname">SetFromComplex</tt><big>(</big><em>newValue</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Complex.SetFromComplex" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets this value from <em>newValue</em> which must be a
<a class="reference internal" href="#pyslet.odata2.csdl.Complex" title="pyslet.odata2.csdl.Complex"><tt class="xref py py-class docutils literal"><span class="pre">Complex</span></tt></a> instance.</p>
<p>There is no requirement that <em>newValue</em> is of the same type,
but it must be broadly compatible, which is defined as:</p>
<blockquote>
<div>Any named property present in both the current value and
<em>newValue</em> must be of compatible types.</div></blockquote>
<p>Any named property in the current value which is not present in
<em>newValue</em> is left unchanged by this method.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="navigation-deferred-values">
<h3>2.1.3.1.1.3. Navigation: Deferred Values<a class="headerlink" href="#navigation-deferred-values" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pyslet.odata2.csdl.DeferredValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DeferredValue</tt><big>(</big><em>name</em>, <em>fromEntity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Represents the value of a navigation property.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the associated navigation property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.fromEntity">
<tt class="descname">fromEntity</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.fromEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>the entity that contains this value</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.pDef">
<tt class="descname">pDef</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.pDef" title="Permalink to this definition">¶</a></dt>
<dd><p>the definition of the navigation property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.isRequired">
<tt class="descname">isRequired</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.isRequired" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this deferred value represents a (single) required entity</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.isCollection">
<tt class="descname">isCollection</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.isCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this deferred value represents a collection</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.isExpanded">
<tt class="descname">isExpanded</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.isExpanded" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this deferred value has been expanded.</p>
<p>An expanded navigation property will return a read-only
<a class="reference internal" href="#pyslet.odata2.csdl.ExpandedEntityCollection" title="pyslet.odata2.csdl.ExpandedEntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">ExpandedEntityCollection</span></tt></a> when
<a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue.OpenCollection" title="pyslet.odata2.csdl.DeferredValue.OpenCollection"><tt class="xref py py-meth docutils literal"><span class="pre">OpenCollection()</span></tt></a> is called.</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DeferredValue.bindings">
<tt class="descname">bindings</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.bindings" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of entity instances or keys to bind to <em>fromEntity</em>
when it is inserted or next updated.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.Target">
<tt class="descname">Target</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.Target" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the target entity set of this navigation (without opening the collection).</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.GetEntity">
<tt class="descname">GetEntity</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.GetEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a single entity instance or None.</p>
<p>If this deferred value represents an entity collection then
NavigationError is raised.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.OpenCollection">
<tt class="descname">OpenCollection</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.OpenCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens the collection associated with this navigation property.</p>
<p>Returns an <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a> instance which must be closed
when it is no longer needed.  This is best achieved with the
Python with statement using the collection&#8217;s context-manager
behaviour.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre>with customer[&#39;Orders&#39;].OpenCollection() as orders:
        # do something with the orders
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.SetExpansion">
<tt class="descname">SetExpansion</tt><big>(</big><em>expandedCollection</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.SetExpansion" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the expansion for this deferred value to the <a class="reference internal" href="#pyslet.odata2.csdl.ExpandedEntityCollection" title="pyslet.odata2.csdl.ExpandedEntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">ExpandedEntityCollection</span></tt></a> given.</p>
<p>If <em>expandedCollection</em> is None then the expansion is removed
and future calls to <tt class="xref py py-meth docutils literal"><span class="pre">OpenColection()</span></tt> will yield a
(dynamically created) entity collection.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.ExpandCollection">
<tt class="descname">ExpandCollection</tt><big>(</big><em>expand</em>, <em>select</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.ExpandCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>A convenience function of use to data providers.</p>
<p>Expands this navigation property, further expanding the
resulting collection of entities using the given <em>expand</em> and
<em>select</em> options (see <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.Expand" title="pyslet.odata2.csdl.EntityCollection.Expand"><tt class="xref py py-meth docutils literal"><span class="pre">EntityCollection.Expand()</span></tt></a> for
details).</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.BindEntity">
<tt class="descname">BindEntity</tt><big>(</big><em>target</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.BindEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Binds a <em>target</em> entity to this navigation property.</p>
<p><em>target</em> is either the entity you&#8217;re binding or its key in the
target entity set. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">customer</span><span class="p">[</span><span class="s">&#39;Orders&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
<p>binds the entity represented by &#8216;customer&#8217; to the Order entity
with key 1.</p>
<p>Just as for updates to data property values, the binding
information is saved and acted upon when the entity is next
updated or, for non-existent entities, inserted into the entity
set.</p>
<p>If you attempt to bind to a target entity that doesn&#8217;t exist the
target entity will be created automatically when the source
entity is updated or inserted.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.CheckNavigationConstraint">
<tt class="descname">CheckNavigationConstraint</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.CheckNavigationConstraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if this navigation property <a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue.isRequired" title="pyslet.odata2.csdl.DeferredValue.isRequired"><tt class="xref py py-attr docutils literal"><span class="pre">isRequired</span></tt></a> and
raises <tt class="xref py py-class docutils literal"><span class="pre">NavigationConstraintError</span></tt> if it has not been
bound with <a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue.BindEntity" title="pyslet.odata2.csdl.DeferredValue.BindEntity"><tt class="xref py py-meth docutils literal"><span class="pre">BindEntity()</span></tt></a>.</p>
<p>This method is only intended to be called on non-existent
entities.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.UpdateBindings">
<tt class="descname">UpdateBindings</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.UpdateBindings" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates through <a class="reference internal" href="#pyslet.odata2.csdl.DeferredValue.bindings" title="pyslet.odata2.csdl.DeferredValue.bindings"><tt class="xref py py-attr docutils literal"><span class="pre">bindings</span></tt></a> and generates appropriate calls
to update the collection.</p>
<p>Unlike the parent Entity&#8217;s <a class="reference internal" href="#pyslet.odata2.csdl.Entity.Update" title="pyslet.odata2.csdl.Entity.Update"><tt class="xref py py-meth docutils literal"><span class="pre">Entity.Update()</span></tt></a> method, which updates all
data and navigation values simultaneously, this method can be used to selectively
update a single navigation property.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DeferredValue.ClearBindings">
<tt class="descname">ClearBindings</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DeferredValue.ClearBindings" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes any (unsaved) entity bindings from this navigation
property.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.NavigationCollection">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NavigationCollection</tt><big>(</big><em>fromEntity</em>, <em>name</em>, <em>**kwArgs</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EntityCollection</span></tt></a></p>
<p>Represents the collection of entities returned by a <em>navigation</em>
property.</p>
<p>These collections behave in the same way as entity collections
opened from the base <a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a> with the following
exceptions:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">etColl</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">=</span><span class="n">entity</span>
</pre></div>
</div>
<p>Adds a link to <em>entity</em> from the source entity used to open the
navigation collection.  If <em>key</em> does not match <em>entity</em>&#8216;s key then
ValueError is raised. The entity must already exist and be a member
of the base entity set, otherwise KeyError is raised.</p>
<p>This class is used even if the navigation property is declared to
return a single entity, rather than a collection.  In this case
assignment will only work if the collection is currently empty. To
<em>replace</em> an existing link use <a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection.Replace" title="pyslet.odata2.csdl.NavigationCollection.Replace"><tt class="xref py py-meth docutils literal"><span class="pre">Replace()</span></tt></a>.</p>
<blockquote>
<div>del etColl[key]</div></blockquote>
<p>Deletes the link from the source entity to the entity with <em>key</em>. If
no such link exists, KeyError is raised.</p>
<p>Thie behaviour differs from the base <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a>
behaviour where the del operator removes the entity completely from
the entity container.  In this case the entity still exists in the
parent entity set, only the link is removed.</p>
<p>Notes for data providers</p>
<p>On construction:</p>
<ul class="simple">
<li><em>entitySet</em> is the entity set containing the target entities,
the collection behaves like a subset of this entity set.  It is
passed to super</li>
</ul>
<p>Named arguments specific to this class:</p>
<ul class="simple">
<li><em>fromEntity</em> is the source entity being navigated</li>
<li><em>name</em> is the name of the navigation property being navigated</li>
</ul>
<p>Writeable collections must override the <tt class="xref py py-meth docutils literal"><span class="pre">__setitem__()</span></tt>
method.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationCollection.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the navigation property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationCollection.fromEntity">
<tt class="descname">fromEntity</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.fromEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>the source entity</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationCollection.fromEnd">
<tt class="descname">fromEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.fromEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>the <tt class="xref py py-class docutils literal"><span class="pre">associationSetEnd</span></tt> that represents the source of this association</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationCollection.pDef">
<tt class="descname">pDef</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.pDef" title="Permalink to this definition">¶</a></dt>
<dd><p>the navigation property&#8217;s definition in the metadata model</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NavigationCollection.InsertEntity">
<tt class="descname">InsertEntity</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.InsertEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Inserts a new <em>entity</em> into the target entity set <em>and</em>
simultaneously creates a link to it from the source entity.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NavigationCollection.Replace">
<tt class="descname">Replace</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NavigationCollection.Replace" title="Permalink to this definition">¶</a></dt>
<dd><p>This method replaces all links with a link to the single
item, <em>entity</em>.  If the collection was empty then this is
equivalent to __setitem__(entity.Key(),entity).</p>
<p>Although for some collections this is equivalent to
<tt class="xref py py-meth docutils literal"><span class="pre">clear()</span></tt> followed by __setitem__, this method must be
used to combine these operations into a single call when the
collection is required to contain exactly one link at all
times.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ExpandedEntityCollection">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ExpandedEntityCollection</tt><big>(</big><em>entityList</em>, <em>**kwArgs</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.ExpandedEntityCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection" title="pyslet.odata2.csdl.NavigationCollection"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NavigationCollection</span></tt></a></p>
<p>A special sub-class of <a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection" title="pyslet.odata2.csdl.NavigationCollection"><tt class="xref py py-class docutils literal"><span class="pre">NavigationCollection</span></tt></a>
used when a navigation property has been expanded.</p>
<p>An expanded entity collection is a read-only, cached view of the
entities linked from the source entity.</p>
<p>Warning: although you may apply a filter and orderby rules to an
expanded collection these are evaluated on the local copy and are
not passed to the data source.  As a result, there may be
differences in the way these options behave due to different
expression semantics.</p>
<p>Note for data providers:</p>
<p>The named argument <em>entityList</em> passed to this constructor is a
simple python list of the entities the expanded collection contains.
Internally a dictionary of the entities is built to speed up access
by key.</p>
</dd></dl>

</div>
<div class="section" id="supporting-classes">
<h3>2.1.3.1.1.4. Supporting Classes<a class="headerlink" href="#supporting-classes" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pyslet.odata2.csdl.EDMValue">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EDMValue</tt><big>(</big><em>pDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Abstract class to represent a value in the EDMModel.</p>
<p>This class is used to wrap or &#8216;box&#8217; instances of a value.  In
particular, it can be used in a context where that value can have
either a simple or complex type.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.EDMValue.pDef">
<tt class="descname">pDef</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.pDef" title="Permalink to this definition">¶</a></dt>
<dd><p>An optional <a class="reference internal" href="#pyslet.odata2.csdl.Property" title="pyslet.odata2.csdl.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> instance from the metadata
model defining this value&#8217;s type</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EDMValue.__nonzero__">
<tt class="descname">__nonzero__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.__nonzero__" title="Permalink to this definition">¶</a></dt>
<dd><p>EDMValue instances are treated as being non-zero if <a class="reference internal" href="#pyslet.odata2.csdl.EDMValue.IsNull" title="pyslet.odata2.csdl.EDMValue.IsNull"><tt class="xref py py-meth docutils literal"><span class="pre">IsNull()</span></tt></a>
returns False.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EDMValue.IsNull">
<tt class="descname">IsNull</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.IsNull" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if this object is Null.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyslet.odata2.csdl.EDMValue.NewValue">
<em class="property">classmethod </em><tt class="descname">NewValue</tt><big>(</big><em>pDef</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.NewValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs an instance of the correct child class of
<a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> to represent a value defined by
<a class="reference internal" href="#pyslet.odata2.csdl.Property" title="pyslet.odata2.csdl.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> instance <em>pDef</em>.</p>
<p>We support a special case for creating a type-less NULL.  If you
pass None for pDef then a type-less
<tt class="xref py py-class docutils literal"><span class="pre">SipmleValue</span></tt> is instantiated.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyslet.odata2.csdl.EDMValue.NewSimpleValue">
<em class="property">classmethod </em><tt class="descname">NewSimpleValue</tt><big>(</big><em>typeCode</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.NewSimpleValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs an instance of the correct child class of
<a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> to represent an (undeclared) simple
value of <a class="reference internal" href="#pyslet.odata2.csdl.SimpleType" title="pyslet.odata2.csdl.SimpleType"><tt class="xref py py-class docutils literal"><span class="pre">SimpleType</span></tt></a> <em>typeCode</em>.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyslet.odata2.csdl.EDMValue.NewSimpleValueFromValue">
<em class="property">classmethod </em><tt class="descname">NewSimpleValueFromValue</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.NewSimpleValueFromValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs an instance of the correct child class of
<a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> to hold <em>value</em>.</p>
<p><em>value</em> may be any of the types listed in
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EDMValue.__weakref__">
<tt class="descname">__weakref__</tt><a class="headerlink" href="#pyslet.odata2.csdl.EDMValue.__weakref__" title="Permalink to this definition">¶</a></dt>
<dd><p>list of weak references to the object (if defined)</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.TypeInstance">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">TypeInstance</tt><big>(</big><em>typeDef=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.TypeInstance" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike" title="pyslet.odata2.csdl.DictionaryLike"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.DictionaryLike</span></tt></a></p>
<p>Abstract class to represents a single instance of a
<a class="reference internal" href="#pyslet.odata2.csdl.ComplexType" title="pyslet.odata2.csdl.ComplexType"><tt class="xref py py-class docutils literal"><span class="pre">ComplexType</span></tt></a> or <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a>.</p>
<p>Behaves like a read-only dictionary mapping property names onto
<a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> instances.  (You can change the value of a
property using the methods of <a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> and its
descendants.)</p>
<p>Unlike regular Python dictionaries, iteration over the of keys in
the dictionary (the names of the properties) is always done in the
order in which they are declared in the type definition.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.TypeInstance.typeDef">
<tt class="descname">typeDef</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.TypeInstance.typeDef" title="Permalink to this definition">¶</a></dt>
<dd><p>the definition of this type</p>
</dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="metadata-model">
<h2>2.1.3.1.2. Metadata Model<a class="headerlink" href="#metadata-model" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.odata2.csdl.CSDLElement">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">CSDLElement</tt><big>(</big><em>parent</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.CSDLElement" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">pyslet.xmlnames20091208.XMLNSElement</span></tt></p>
<p>All elements in the metadata model inherit from this class.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Schema">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Schema</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Schema" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NameTableMixin</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Represents the Edm root element.</p>
<p>Schema instances are based on <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> allowing
you to look up the names of declared Associations, ComplexTypes,
EntityTypes, EntityContainers and Functions using dictionary-like
methods.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Schema.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Schema.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of this schema</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Schema.Association">
<tt class="descname">Association</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Schema.Association" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.Association" title="pyslet.odata2.csdl.Association"><tt class="xref py py-class docutils literal"><span class="pre">Association</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Schema.ComplexType">
<tt class="descname">ComplexType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Schema.ComplexType" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.ComplexType" title="pyslet.odata2.csdl.ComplexType"><tt class="xref py py-class docutils literal"><span class="pre">ComplexType</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Schema.EntityType">
<tt class="descname">EntityType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Schema.EntityType" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Schema.EntityContainer">
<tt class="descname">EntityContainer</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Schema.EntityContainer" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.EntityContainer" title="pyslet.odata2.csdl.EntityContainer"><tt class="xref py py-class docutils literal"><span class="pre">EntityContainer</span></tt></a> instances</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.EntityContainer">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EntityContainer</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityContainer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NameTableMixin</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models an entity container in the metadata model.</p>
<p>An EntityContainer inherits from <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> to
enable it to behave like a scope.  The <a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a>
instances and <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSet" title="pyslet.odata2.csdl.AssociationSet"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSet</span></tt></a> instances it contains are
declared within the scope.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityContainer.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityContainer.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of the container</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityContainer.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityContainer.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityContainer.EntitySet">
<tt class="descname">EntitySet</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityContainer.EntitySet" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityContainer.AssociationSet">
<tt class="descname">AssociationSet</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityContainer.AssociationSet" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSet" title="pyslet.odata2.csdl.AssociationSet"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSet</span></tt></a> instances</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.EntitySet">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EntitySet</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Represents an EntitySet in the metadata model.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of the entity set</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.entityTypeName">
<tt class="descname">entityTypeName</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.entityTypeName" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the entity type of this set&#8217;s elements</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.entityType">
<tt class="descname">entityType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.entityType" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a> of this set&#8217;s elements</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.keys">
<tt class="descname">keys</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.keys" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of the names of this entity set&#8217;s keys in their declared order</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.navigation">
<tt class="descname">navigation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.navigation" title="Permalink to this definition">¶</a></dt>
<dd><p>a mapping from navigation property names to <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd" title="pyslet.odata2.csdl.AssociationSetEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSetEnd</span></tt></a> instances</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.linkEnds">
<tt class="descname">linkEnds</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.linkEnds" title="Permalink to this definition">¶</a></dt>
<dd><p>A mapping from <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd" title="pyslet.odata2.csdl.AssociationSetEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSetEnd</span></tt></a> instances that
reference this entity set to navigation property names (or None
if this end of the association is not bound to a named
navigation property)</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.unboundPrincipal">
<tt class="descname">unboundPrincipal</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.unboundPrincipal" title="Permalink to this definition">¶</a></dt>
<dd><p>An <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd" title="pyslet.odata2.csdl.AssociationSetEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSetEnd</span></tt></a> that represents our end of
an association with an unbound principal or None if all
principals are bound.</p>
<p>What does that mean?  It means that there is an association set
bound to us where the other role has a multiplicity of 1
(required) but our entity type does not have a navigation
property bound to the association.  As a result, our entities
can only be created by a deep insert from the principal (the
entity set at the other end of the association).</p>
<p>Clear as mud?  An example may help.  Suppose that each Order
entity must have an associated Customer but (perhaps perversely)
there is no navigation link from Order to Customer, only from
Customer to Order.  Attempting to create an Order in the base
collection of Orders will always fail:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="n">Orders</span><span class="o">.</span><span class="n">OpenCollection</span><span class="p">()</span> <span class="k">as</span> <span class="n">collection</span><span class="p">:</span>
        <span class="n">order</span><span class="o">=</span><span class="n">collection</span><span class="o">.</span><span class="n">NewEntity</span><span class="p">()</span>
        <span class="c"># set order fields here</span>
        <span class="n">collection</span><span class="o">.</span><span class="n">InsertEntity</span><span class="p">(</span><span class="n">order</span><span class="p">)</span>
        <span class="c"># raises ConstraintError as order is not bound to a customer</span>
</pre></div>
</div>
<p>Instead, you have to create new orders from a Customer entity:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="n">Customers</span><span class="o">.</span><span class="n">OpenCollection</span><span class="p">()</span> <span class="k">as</span> <span class="n">collectionCustomers</span><span class="p">:</span>
        <span class="c"># get the existing customer</span>
        <span class="n">customer</span><span class="o">=</span><span class="n">collectionCustomers</span><span class="p">[</span><span class="s">&#39;ALFKI&#39;</span><span class="p">]</span>
        <span class="k">with</span> <span class="n">customer</span><span class="p">[</span><span class="s">&#39;Orders&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">OpenCollection</span><span class="p">()</span> <span class="k">as</span> <span class="n">collectionOrders</span><span class="p">:</span>
                <span class="c"># create a new order</span>
                <span class="n">order</span><span class="o">=</span><span class="n">collectionOrders</span><span class="o">.</span><span class="n">NewEntity</span><span class="p">()</span>
                <span class="c"># ... set order details here</span>
                <span class="n">collectionOrders</span><span class="o">.</span><span class="n">InsertEntity</span><span class="p">(</span><span class="n">order</span><span class="p">)</span>
</pre></div>
</div>
<p>You can also use a deep insert:</p>
<div class="highlight-python"><div class="highlight"><pre>with Customers.OpenCollection() as collectionCustomers,
                Orders.OpenCollection() as collectionOrders:
        customer=collectionCustomers.NewEntity()
        # set customer details here
        order=collectionOrders.NewEntity()
        # set order details here
        customer[&#39;Orders&#39;].BindEntity(order)
        collectionCustomers.InsertEntity(customer)
</pre></div>
</div>
<p>For the avoidance of doubt, an entity set can&#8217;t have two unbound
principals because if it did you would never be able to create
entities in it!</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntitySet.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.GetFQName">
<tt class="descname">GetFQName</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.GetFQName" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the fully qualified name of this entity set.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.GetLocation">
<tt class="descname">GetLocation</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.GetLocation" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="rfc2396.html#pyslet.rfc2396.URI" title="pyslet.rfc2396.URI"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.rfc2396.URI</span></tt></a> instance
representing the location for this entity set.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.SetLocation">
<tt class="descname">SetLocation</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.SetLocation" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the location of this entity set by resolving a relative
path consisting of:</p>
<div class="highlight-python"><div class="highlight"><pre>[ EntityContainer.name &#39;.&#39; ] name
</pre></div>
</div>
<p>The resolution of URIs is done in accordance with the XML
specification, so is affected by any xml:base attributes set on
parent elements or by the original base URI used to load the
metadata model.  If no base URI can be found then the location
remains expressed in relative terms.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.GetKey">
<tt class="descname">GetKey</tt><big>(</big><em>keylike</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.GetKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Extracts a key value suitable for using as a key in an
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a> based on this entity set.</p>
<p>Keys are represented as python values (as described in
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a>) or as tuples of python values in the
case of compound keys.  The order of the values in a compound
key is the order in which the Key properties are defined in the
corresponding EntityType definition.</p>
<p>If <em>keylike</em> is already in the correct format for this entity
type then it is returned unchanged.</p>
<p>If the key is single-valued and <em>keylike</em> is a tuple containing
a single value then the single value is returned without the
tuple wrapper.</p>
<p>If <em>keylike</em> is a dictionary, or an <a class="reference internal" href="#pyslet.odata2.csdl.Entity" title="pyslet.odata2.csdl.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a> instance,
which maps property names to values (or to
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instances) the key is calculated from it
by extracting the key properties.  As a special case, a value
mapped with a dictionary key of the empty string is assumed to
be the value of the key property for an entity type with a
single-valued key, but only if the key property&#8217;s name is not
itself in the dictionary.</p>
<p>If <em>keylike</em> cannot be turned in to a valid key the KeyError is
raised.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.GetKeyDict">
<tt class="descname">GetKeyDict</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.GetKeyDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a key from this entity set, returns a key dictionary.</p>
<p>The result is a mapping from named properties to
<a class="reference internal" href="#pyslet.odata2.csdl.SimpleValue" title="pyslet.odata2.csdl.SimpleValue"><tt class="xref py py-class docutils literal"><span class="pre">SimpleValue</span></tt></a> instances.  As a special case, if a
single property defines the entity key it is represented using
the empty string, <em>not</em> the property name.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.Bind">
<tt class="descname">Bind</tt><big>(</big><em>entityCollectionBinding</em>, <em>**extraArgs</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.Bind" title="Permalink to this definition">¶</a></dt>
<dd><p>Binds this entity set to a specific class or callable used by
<a class="reference internal" href="#pyslet.odata2.csdl.EntitySet.OpenCollection" title="pyslet.odata2.csdl.EntitySet.OpenCollection"><tt class="xref py py-meth docutils literal"><span class="pre">OpenCollection()</span></tt></a></p>
<p><em>entityCollectionBinding</em> must be a class (or other callable)
that returns an <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a> instance, by
default we are bound to the default EntityCollection class which
behaves like an empty collection.</p>
<p><em>extraArgs</em> is a python dict of named arguments to pass to the
binding callable</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.OpenCollection">
<tt class="descname">OpenCollection</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.OpenCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an <a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection" title="pyslet.odata2.csdl.EntityCollection"><tt class="xref py py-class docutils literal"><span class="pre">EntityCollection</span></tt></a> instance suitable for
accessing the entities themselves.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.BindNavigation">
<tt class="descname">BindNavigation</tt><big>(</big><em>name</em>, <em>entityCollectionBinding</em>, <em>**extraArgs</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.BindNavigation" title="Permalink to this definition">¶</a></dt>
<dd><p>Binds the navigation property <em>name</em> to a class or callable
used by <a class="reference internal" href="#pyslet.odata2.csdl.EntitySet.OpenNavigation" title="pyslet.odata2.csdl.EntitySet.OpenNavigation"><tt class="xref py py-meth docutils literal"><span class="pre">OpenNavigation()</span></tt></a></p>
<p><em>entityCollectionBinding</em> must be a class (or other callable)
that returns a <a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection" title="pyslet.odata2.csdl.NavigationCollection"><tt class="xref py py-class docutils literal"><span class="pre">NavigationCollection</span></tt></a> instance.
By default we are bound to the default
NavigationCollection class which behaves like an empty
collection.</p>
<p><em>extraArgs</em> is a python dict of named arguments to pass to the
binding callable</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.OpenNavigation">
<tt class="descname">OpenNavigation</tt><big>(</big><em>name</em>, <em>sourceEntity</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.OpenNavigation" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="#pyslet.odata2.csdl.NavigationCollection" title="pyslet.odata2.csdl.NavigationCollection"><tt class="xref py py-class docutils literal"><span class="pre">NavigationCollection</span></tt></a> instance
suitable for accessing the entities obtained by navigating from
<em>sourceEntity</em>, an <a class="reference internal" href="#pyslet.odata2.csdl.Entity" title="pyslet.odata2.csdl.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a> instance, via the
navigation property with <em>name</em>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.NavigationTarget">
<tt class="descname">NavigationTarget</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.NavigationTarget" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the target entity set of navigation property <em>name</em></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.NavigationMultiplicity">
<tt class="descname">NavigationMultiplicity</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.NavigationMultiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the <a class="reference internal" href="#pyslet.odata2.csdl.Multiplicity" title="pyslet.odata2.csdl.Multiplicity"><tt class="xref py py-class docutils literal"><span class="pre">Multiplicity</span></tt></a> of both the source and
the target of the named navigation property, as a
tuple, for example, if <em>customers</em> is an entity set from
the sample OData service:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">customers</span><span class="o">.</span><span class="n">NavigationMultiplicity</span><span class="p">[</span><span class="s">&#39;Orders&#39;</span><span class="p">]</span><span class="o">==</span><span class="p">(</span><span class="n">Multiplicity</span><span class="o">.</span><span class="n">ZeroToOne</span><span class="p">,</span><span class="n">Multiplicity</span><span class="o">.</span><span class="n">Many</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntitySet.IsEntityCollection">
<tt class="descname">IsEntityCollection</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntitySet.IsEntityCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if more than one entity is possible when navigating the named property.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.AssociationSet">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">AssociationSet</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Represents an association set in the metadata model.</p>
<p>The purpose of the association set is to bind the ends of an
association to entity sets in the container.</p>
<p>Contrast this with the association element which merely describes
the association between entity types.</p>
<p>At first sight this part of the entity data model can be confusing
but imagine an entity container that contains two entity sets
that have the same entity type.  Any navigation properties that
reference this type will need to be explicitly bound to one or
other of the entity sets in the container.</p>
<blockquote>
<div>As an aside, it isn&#8217;t really clear if the model was intended to
be used this way.  It may have been intended that the entity type
in the definition of an entity set should be unique within the
scope of the entity container.</div></blockquote>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSet.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of this association set</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSet.associationName">
<tt class="descname">associationName</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet.associationName" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the association definition</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSet.association">
<tt class="descname">association</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet.association" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.Association" title="pyslet.odata2.csdl.Association"><tt class="xref py py-class docutils literal"><span class="pre">Association</span></tt></a> definition</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSet.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSet.AssociationSetEnd">
<tt class="descname">AssociationSetEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSet.AssociationSetEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd" title="pyslet.odata2.csdl.AssociationSetEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSetEnd</span></tt></a> instances</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.AssociationSetEnd">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">AssociationSetEnd</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Represents the links between two actual sets of entities in the
metadata model.</p>
<p>The <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd.GetQualifiedName" title="pyslet.odata2.csdl.AssociationSetEnd.GetQualifiedName"><tt class="xref py py-meth docutils literal"><span class="pre">GetQualifiedName()</span></tt></a> method defines the identity of this
element.  The built-in Python hash function returns a hash based on
this value and the associated comparison functions are also
implemented enabling these elements to be added to ordinary Python
dictionaries.</p>
<p>Oddly, role names are sometimes treated as optional but it can make
it a challenge to work out which end of the association is which
when we are actually using the model if one or both are missing. 
The algorithm we use is to use role names if either are given,
otherwise we match the entity types.  If these are also identical
then the choice is arbitrary.  To prevent confusion missing role
names are filled in when the metadata model is loaded.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the role-name given to this end of the link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.entitySetName">
<tt class="descname">entitySetName</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.entitySetName" title="Permalink to this definition">¶</a></dt>
<dd><p>name of the entity set this end links to</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.entitySet">
<tt class="descname">entitySet</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.entitySet" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a> this end links to</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.associationEnd">
<tt class="descname">associationEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.associationEnd" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> that defines this end of the link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.otherEnd">
<tt class="descname">otherEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.otherEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>the other <a class="reference internal" href="#pyslet.odata2.csdl.AssociationSetEnd" title="pyslet.odata2.csdl.AssociationSetEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSetEnd</span></tt></a> of this link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.AssociationSetEnd.GetQualifiedName">
<tt class="descname">GetQualifiedName</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.AssociationSetEnd.GetQualifiedName" title="Permalink to this definition">¶</a></dt>
<dd><p>A utility function to return a qualified name.</p>
<p>The qualified name comprises the name of the parent
<a class="reference internal" href="#pyslet.odata2.csdl.AssociationSet" title="pyslet.odata2.csdl.AssociationSet"><tt class="xref py py-class docutils literal"><span class="pre">AssociationSet</span></tt></a> and the role name.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Type">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Type</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Type" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NameTableMixin</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>An abstract class for both Entity and Complex types.</p>
<p>Types inherit from <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> to allow them to
behave as scopes in their own right.  The named properties are
declared in the type&#8217;s scope enabling you so use them as
dictionaries to look up property definitions.</p>
<p>Because of the way nested scopes work, this means that you
can concatenate names to do a deep look up, for example, if
Person is a defined type:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">Person</span><span class="p">[</span><span class="s">&#39;Address&#39;</span><span class="p">][</span><span class="s">&#39;City&#39;</span><span class="p">]</span> <span class="ow">is</span> <span class="n">Person</span><span class="p">[</span><span class="s">&#39;Address.City&#39;</span><span class="p">]</span>
</pre></div>
</div>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Type.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Type.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of this type</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Type.baseType">
<tt class="descname">baseType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Type.baseType" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the base-type for this type</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Type.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Type.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Type.Property">
<tt class="descname">Property</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Type.Property" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.Property" title="pyslet.odata2.csdl.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Type.GetFQName">
<tt class="descname">GetFQName</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Type.GetFQName" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the full name of this type, including the schema namespace prefix.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.EntityType">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EntityType</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityType" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.Type" title="pyslet.odata2.csdl.Type"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.Type</span></tt></a></p>
<p>Models the key and the collection of properties that define a set
of <a class="reference internal" href="#pyslet.odata2.csdl.Entity" title="pyslet.odata2.csdl.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a></p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityType.Key">
<tt class="descname">Key</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityType.Key" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.Key" title="pyslet.odata2.csdl.Key"><tt class="xref py py-class docutils literal"><span class="pre">Key</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.EntityType.NavigationProperty">
<tt class="descname">NavigationProperty</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.EntityType.NavigationProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.NavigationProperty" title="pyslet.odata2.csdl.NavigationProperty"><tt class="xref py py-class docutils literal"><span class="pre">NavigationProperty</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.EntityType.ValidateExpansion">
<tt class="descname">ValidateExpansion</tt><big>(</big><em>expand</em>, <em>select</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EntityType.ValidateExpansion" title="Permalink to this definition">¶</a></dt>
<dd><p>A utility method for data providers.</p>
<p>Checks the expand and select options, as described in
<a class="reference internal" href="#pyslet.odata2.csdl.EntityCollection.Expand" title="pyslet.odata2.csdl.EntityCollection.Expand"><tt class="xref py py-meth docutils literal"><span class="pre">EntityCollection.Expand()</span></tt></a> for validity raising
ValueError if they violate the OData specification.</p>
<p>Specifically the following are checked:</p>
<ol class="arabic simple">
<li>That &#8220;*&#8221; only ever appears as the last item in a select
path</li>
<li>That nothing appears after a simple property in a select
path</li>
<li>That all names are valid property names</li>
<li>That all expanded names are those of navigation properties</li>
</ol>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Key">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Key</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Key" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models the key fields of an <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a></p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Key.PropertyRef">
<tt class="descname">PropertyRef</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Key.PropertyRef" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.PropertyRef" title="pyslet.odata2.csdl.PropertyRef"><tt class="xref py py-class docutils literal"><span class="pre">PropertyRef</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.PropertyRef">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">PropertyRef</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.PropertyRef" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models a reference to a single property within a <a class="reference internal" href="#pyslet.odata2.csdl.Key" title="pyslet.odata2.csdl.Key"><tt class="xref py py-class docutils literal"><span class="pre">Key</span></tt></a>.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.PropertyRef.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.PropertyRef.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of this (key) property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.PropertyRef.property">
<tt class="descname">property</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.PropertyRef.property" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.Property" title="pyslet.odata2.csdl.Property"><tt class="xref py py-class docutils literal"><span class="pre">Property</span></tt></a> instance of this (key) property</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.PropertyRef.UpdateTypeRefs">
<tt class="descname">UpdateTypeRefs</tt><big>(</big><em>scope</em>, <em>stopOnErrors=False</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.PropertyRef.UpdateTypeRefs" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets <a class="reference internal" href="#pyslet.odata2.csdl.PropertyRef.property" title="pyslet.odata2.csdl.PropertyRef.property"><tt class="xref py py-attr docutils literal"><span class="pre">property</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Property">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Property</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Property" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models a property of an <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a> or
<a class="reference internal" href="#pyslet.odata2.csdl.ComplexType" title="pyslet.odata2.csdl.ComplexType"><tt class="xref py py-class docutils literal"><span class="pre">ComplexType</span></tt></a>.</p>
<p>Instances of this class are callable, taking an optional string
literal.  They return a new
<a class="reference internal" href="#pyslet.odata2.csdl.EDMValue" title="pyslet.odata2.csdl.EDMValue"><tt class="xref py py-class docutils literal"><span class="pre">EDMValue</span></tt></a> instance with a value set from the
optional literal or NULL if no literal was supplied.  Complex values
can&#8217;t be created from a literal.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of the property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.type">
<tt class="descname">type</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.type" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the property&#8217;s type</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.simpleTypeCode">
<tt class="descname">simpleTypeCode</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.simpleTypeCode" title="Permalink to this definition">¶</a></dt>
<dd><p>one of the <a class="reference internal" href="#pyslet.odata2.csdl.SimpleType" title="pyslet.odata2.csdl.SimpleType"><tt class="xref py py-class docutils literal"><span class="pre">SimpleType</span></tt></a> constants if the property has a simple type</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.complexType">
<tt class="descname">complexType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.complexType" title="Permalink to this definition">¶</a></dt>
<dd><p>the associated <a class="reference internal" href="#pyslet.odata2.csdl.ComplexType" title="pyslet.odata2.csdl.ComplexType"><tt class="xref py py-class docutils literal"><span class="pre">ComplexType</span></tt></a> if the property has a complex type</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.nullable">
<tt class="descname">nullable</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.nullable" title="Permalink to this definition">¶</a></dt>
<dd><p>if the property may have a null value</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.defaultValue">
<tt class="descname">defaultValue</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.defaultValue" title="Permalink to this definition">¶</a></dt>
<dd><p>a string containing the default value for the property or None if no default is defined</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.maxLength">
<tt class="descname">maxLength</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.maxLength" title="Permalink to this definition">¶</a></dt>
<dd><p>the maximum length permitted for property values</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.fixedLength">
<tt class="descname">fixedLength</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.fixedLength" title="Permalink to this definition">¶</a></dt>
<dd><p>a boolean indicating that the property must be of length <a class="reference internal" href="#pyslet.odata2.csdl.Property.maxLength" title="pyslet.odata2.csdl.Property.maxLength"><tt class="xref py py-attr docutils literal"><span class="pre">maxLength</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.precision">
<tt class="descname">precision</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.precision" title="Permalink to this definition">¶</a></dt>
<dd><p>a positive integer indicating the maximum number of decimal digits (decimal values)</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.scale">
<tt class="descname">scale</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.scale" title="Permalink to this definition">¶</a></dt>
<dd><p>a non-negative integer indicating the maximum number of decimal digits to the right of the point</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.unicode">
<tt class="descname">unicode</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.unicode" title="Permalink to this definition">¶</a></dt>
<dd><p>a boolean indicating that a string property contains unicode data</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Property.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Property.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ComplexType">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ComplexType</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.ComplexType" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.Type" title="pyslet.odata2.csdl.Type"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.Type</span></tt></a></p>
<p>Models the collection of properties that define a
<a class="reference internal" href="#pyslet.odata2.csdl.Complex" title="pyslet.odata2.csdl.Complex"><tt class="xref py py-class docutils literal"><span class="pre">Complex</span></tt></a> value.</p>
<p>This class is a trivial sub-class of <a class="reference internal" href="#pyslet.odata2.csdl.Type" title="pyslet.odata2.csdl.Type"><tt class="xref py py-class docutils literal"><span class="pre">Type</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.NavigationProperty">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NavigationProperty</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models a navigation property of an <a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a>.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the declared name of the navigation property</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.relationship">
<tt class="descname">relationship</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.relationship" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of the association described by this link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.association">
<tt class="descname">association</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.association" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.Association" title="pyslet.odata2.csdl.Association"><tt class="xref py py-class docutils literal"><span class="pre">Association</span></tt></a> described by this link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.fromRole">
<tt class="descname">fromRole</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.fromRole" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of this link&#8217;s source role</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.toRole">
<tt class="descname">toRole</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.toRole" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of this link&#8217;s target role</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.fromEnd">
<tt class="descname">fromEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.fromEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> instance representing this link&#8217;s source</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.toEnd">
<tt class="descname">toEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.toEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> instance representing this link&#8217;s target</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.backLink">
<tt class="descname">backLink</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.backLink" title="Permalink to this definition">¶</a></dt>
<dd><p>the <a class="reference internal" href="#pyslet.odata2.csdl.NavigationProperty" title="pyslet.odata2.csdl.NavigationProperty"><tt class="xref py py-class docutils literal"><span class="pre">NavigationProperty</span></tt></a> that provides the back link (or None, if this link is one-way)</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NavigationProperty.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NavigationProperty.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Association">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Association</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Association" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.NameTableMixin</span></tt></a>, <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models an association.</p>
<p>This class inherits from <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> to enable it to
behave like a scope in its own right.  The contained
<a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> instances are declared in the association
scope by role name.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Association.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Association.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name declared for this association</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Association.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Association.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Association.AssociationEnd">
<tt class="descname">AssociationEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.Association.AssociationEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>a list of <a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> instances</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.AssociationEnd">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">AssociationEnd</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Models one end of an <a class="reference internal" href="#pyslet.odata2.csdl.Association" title="pyslet.odata2.csdl.Association"><tt class="xref py py-class docutils literal"><span class="pre">Association</span></tt></a>.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the role-name given to this end of the link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.type">
<tt class="descname">type</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.type" title="Permalink to this definition">¶</a></dt>
<dd><p>name of the entity type this end links to</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.entityType">
<tt class="descname">entityType</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.entityType" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a> this end links to</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.multiplicity">
<tt class="descname">multiplicity</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.multiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>a <a class="reference internal" href="#pyslet.odata2.csdl.Multiplicity" title="pyslet.odata2.csdl.Multiplicity"><tt class="xref py py-class docutils literal"><span class="pre">Multiplicity</span></tt></a> constant</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.otherEnd">
<tt class="descname">otherEnd</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.otherEnd" title="Permalink to this definition">¶</a></dt>
<dd><p>the other <a class="reference internal" href="#pyslet.odata2.csdl.AssociationEnd" title="pyslet.odata2.csdl.AssociationEnd"><tt class="xref py py-class docutils literal"><span class="pre">AssociationEnd</span></tt></a> of this link</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.AssociationEnd.Documentation">
<tt class="descname">Documentation</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.AssociationEnd.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>the optional <a class="reference internal" href="#pyslet.odata2.csdl.Documentation" title="pyslet.odata2.csdl.Documentation"><tt class="xref py py-class docutils literal"><span class="pre">Documentation</span></tt></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Documentation">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Documentation</tt><big>(</big><em>parent</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Documentation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.CSDLElement" title="pyslet.odata2.csdl.CSDLElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.CSDLElement</span></tt></a></p>
<p>Used to document elements in the metadata model</p>
</dd></dl>

</div>
<div class="section" id="misc-definitions">
<h2>2.1.3.1.3. Misc Definitions<a class="headerlink" href="#misc-definitions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pyslet.odata2.csdl.ValidateSimpleIdentifier">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ValidateSimpleIdentifier</tt><big>(</big><em>identifier</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.ValidateSimpleIdentifier" title="Permalink to this definition">¶</a></dt>
<dd><p>Validates a simple identifier, returning the identifier unchanged or
raising ValueError.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.SimpleType">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">SimpleType</tt><a class="headerlink" href="#pyslet.odata2.csdl.SimpleType" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.xsdatatypes20041028.Enumeration</span></tt></a></p>
<p>SimpleType defines constants for the core data types defined by CSDL</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">SimpleType</span><span class="o">.</span><span class="n">Boolean</span>      
<span class="n">SimpleType</span><span class="o">.</span><span class="n">DEFAULT</span> <span class="o">==</span> <span class="bp">None</span>
</pre></div>
</div>
<p>For more methods see <a class="reference internal" href="xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">Enumeration</span></tt></a></p>
<p>The canonical names for these constants uses the Edm prefix, for
example, &#8220;Edm.String&#8221;.  As a result, the class has attributes of the form
&#8220;SimpleType.Edm.Binary&#8221; which are inaccessible to python unless
getattr is used.  To workaround this problem (and because the Edm.
prefix seems to be optional) we also define aliases without the Edm.
prefix. As a result you can use, e.g., SimpleType.Int32 as the symbolic
representation in code but the following are all True:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">SimpleType</span><span class="o">.</span><span class="n">DecodeValue</span><span class="p">(</span><span class="s">u&quot;Edm.Int32&quot;</span><span class="p">)</span><span class="o">==</span><span class="n">SimpleType</span><span class="o">.</span><span class="n">Int32</span>
<span class="n">SimpleType</span><span class="o">.</span><span class="n">DecodeValue</span><span class="p">(</span><span class="s">u&quot;Int32&quot;</span><span class="p">)</span><span class="o">==</span><span class="n">SimpleType</span><span class="o">.</span><span class="n">Int32</span>
<span class="n">SimpleType</span><span class="o">.</span><span class="n">EncodeValue</span><span class="p">(</span><span class="n">SimpleType</span><span class="o">.</span><span class="n">Int32</span><span class="p">)</span><span class="o">==</span><span class="s">u&quot;Edm.Int32&quot;</span>  
</pre></div>
</div>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.SimpleType.PythonType">
<tt class="descname">PythonType</tt><em class="property"> = {&lt;type 'int'&gt;: 13, &lt;type 'long'&gt;: 7, &lt;type 'str'&gt;: 14, &lt;type 'bool'&gt;: 2, &lt;type 'unicode'&gt;: 14, &lt;type 'float'&gt;: 8}</em><a class="headerlink" href="#pyslet.odata2.csdl.SimpleType.PythonType" title="Permalink to this definition">¶</a></dt>
<dd><p>A python dictionary that maps a type code (defined by the types
module) to a constant from this class indicating a safe
representation in the EDM.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">SimpleType</span><span class="o">.</span><span class="n">PythonType</span><span class="p">[</span><span class="n">types</span><span class="o">.</span><span class="n">IntType</span><span class="p">]</span><span class="o">==</span><span class="n">SimpleType</span><span class="o">.</span><span class="n">Int64</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ConcurrencyMode">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ConcurrencyMode</tt><a class="headerlink" href="#pyslet.odata2.csdl.ConcurrencyMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.xsdatatypes20041028.Enumeration</span></tt></a></p>
<p>ConcurrencyMode defines constants for the concurrency modes defined by CSDL</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">ConcurrencyMode</span><span class="o">.</span><span class="n">Fixed</span>   
<span class="n">ConcurrencyMode</span><span class="o">.</span><span class="n">DEFAULT</span> <span class="o">==</span> <span class="n">ConcurrencyMode</span><span class="o">.</span><span class="n">none</span>
</pre></div>
</div>
<p>Note that although &#8216;Fixed&#8217; and &#8216;None&#8217; are the correct values
lower-case aliases are also defined to allow the value &#8216;none&#8217; to be
accessible through normal attribute access.  In most cases you won&#8217;t
need to worry as a test such as the following is sufficient:</p>
<blockquote>
<div><dl class="docutils">
<dt>if property.concurrencyMode==ConcurrencyMode.Fixed:</dt>
<dd># do something with concurrency tokens</dd>
</dl>
</div></blockquote>
<p>For more methods see <a class="reference internal" href="xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">Enumeration</span></tt></a></p>
</dd></dl>

<dl class="function">
<dt id="pyslet.odata2.csdl.DecodeMaxLength">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DecodeMaxLength</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DecodeMaxLength" title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes a maxLength value from a unicode string.</p>
<p>&#8220;The maxLength facet accepts a value of the literal string &#8220;max&#8221; or a
positive integer with value ranging from 1 to 2^31&#8221;</p>
<p>The value &#8216;max&#8217; is returned as the value <a class="reference internal" href="#pyslet.odata2.csdl.MAX" title="pyslet.odata2.csdl.MAX"><tt class="xref py py-data docutils literal"><span class="pre">MAX</span></tt></a></p>
</dd></dl>

<dl class="function">
<dt id="pyslet.odata2.csdl.EncodeMaxLength">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EncodeMaxLength</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EncodeMaxLength" title="Permalink to this definition">¶</a></dt>
<dd><p>Encodes a maxLength value as a unicode string.</p>
</dd></dl>

<dl class="data">
<dt id="pyslet.odata2.csdl.MAX">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">MAX</tt><em class="property"> = -1</em><a class="headerlink" href="#pyslet.odata2.csdl.MAX" title="Permalink to this definition">¶</a></dt>
<dd><p>we define the constant MAX to represent the spacial &#8216;max&#8217; value of maxLength</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Multiplicity">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Multiplicity</tt><a class="headerlink" href="#pyslet.odata2.csdl.Multiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>Defines constants for representing association end multiplicities.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.Multiplicity.ZeroToOne">
<tt class="descname">ZeroToOne</tt><em class="property"> = 0</em><a class="headerlink" href="#pyslet.odata2.csdl.Multiplicity.ZeroToOne" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>0..1</div></blockquote>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Multiplicity.One">
<tt class="descname">One</tt><em class="property"> = 1</em><a class="headerlink" href="#pyslet.odata2.csdl.Multiplicity.One" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>1</div></blockquote>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.Multiplicity.Many">
<tt class="descname">Many</tt><em class="property"> = 2</em><a class="headerlink" href="#pyslet.odata2.csdl.Multiplicity.Many" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>*</div></blockquote>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="pyslet.odata2.csdl.DecodeMultiplicity">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DecodeMultiplicity</tt><big>(</big><em>src</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DecodeMultiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes a <a class="reference internal" href="#pyslet.odata2.csdl.Multiplicity" title="pyslet.odata2.csdl.Multiplicity"><tt class="xref py py-class docutils literal"><span class="pre">Multiplicity</span></tt></a> value from a unicode string.</p>
<p>The valid strings are &#8220;0..1&#8221;, &#8220;1&#8221; and &#8220;*&#8221;</p>
</dd></dl>

<dl class="function">
<dt id="pyslet.odata2.csdl.EncodeMultiplicity">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EncodeMultiplicity</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.EncodeMultiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>Encodes a <a class="reference internal" href="#pyslet.odata2.csdl.Multiplicity" title="pyslet.odata2.csdl.Multiplicity"><tt class="xref py py-class docutils literal"><span class="pre">Multiplicity</span></tt></a> value as a unicode string.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.Parser">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">Parser</tt><big>(</big><em>source</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">pyslet.unicode5.BasicParser</span></tt></p>
<p>A CSDL-specific parser, mainly for decoding literal values of
simple types.</p>
<p>The individual parsing methods may raise ValueError in cases where
parsed value has a value that is out of range.</p>
<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseBinaryLiteral">
<tt class="descname">ParseBinaryLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseBinaryLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a binary literal, returning a binary string</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseBooleanLiteral">
<tt class="descname">ParseBooleanLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseBooleanLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a boolean literal returning True, False or None if no boolean
literal was found.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseByteLiteral">
<tt class="descname">ParseByteLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseByteLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a byteLiteral, returning a python integer.</p>
<p>We are generous in what we accept, ignoring leading zeros.  Values
outside the range for byte return None.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseDateTimeLiteral">
<tt class="descname">ParseDateTimeLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseDateTimeLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a DateTime literal, returning a <a class="reference internal" href="iso8601.html#pyslet.iso8601.TimePoint" title="pyslet.iso8601.TimePoint"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.iso8601.TimePoint</span></tt></a> instance.</p>
<p>Returns None if no DateTime literal can be parsed.  This is a
generous way of parsing iso8601-like values, it accepts omitted
zeros in the date, such as 4-7-2001.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseGuidLiteral">
<tt class="descname">ParseGuidLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseGuidLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a Guid literal, returning a UUID instance from the
uuid module.</p>
<p>Returns None if no Guid can be parsed.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseNumericLiteral">
<tt class="descname">ParseNumericLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseNumericLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a numeric literal returning a named tuple of strings:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">(</span> <span class="n">sign</span><span class="p">,</span> <span class="n">lDigits</span><span class="p">,</span> <span class="n">rDigits</span><span class="p">,</span> <span class="n">expSign</span><span class="p">,</span> <span class="n">eDigits</span> <span class="p">)</span>
</pre></div>
</div>
<p>An empty string indicates a component that was not present
except that rDigits will be None if no decimal point was
present.  Likewise, eDigits may be None indicating that no
exponent was found.</p>
<p>Although both lDigits and rDigits can be empty they will never
<em>both</em> be empty strings. If there are no digits present then the
method returns None, rather than a tuple.  Therefore, forms like
&#8220;E+3&#8221; are not treated as being numeric literals whereas, perhaps
oddly, 1E+ is parsed as a numeric literal (even though it will
raise ValueError later when setting any of the numeric value
types).</p>
<p>Representations of infinity and not-a-number result in lDigits
being set to &#8216;inf&#8217; and &#8216;nan&#8217; respectively.  They always result
in rDigits and eDigits being None.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.Parser.ParseTimeLiteral">
<tt class="descname">ParseTimeLiteral</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.Parser.ParseTimeLiteral" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a Time literal, returning a <a class="reference internal" href="iso8601.html#pyslet.iso8601.Time" title="pyslet.iso8601.Time"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.iso8601.Time</span></tt></a> instance.</p>
<p>Returns None if no Time literal can be parsed.  This is a
generous way of parsing iso8601-like values, it accepts omitted
zeros in the leading field, such as 7:45:00.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="utility-classes">
<h2>2.1.3.1.4. Utility Classes<a class="headerlink" href="#utility-classes" title="Permalink to this headline">¶</a></h2>
<p>These classes are not specific to the EDM but are used to support the
implementation. They are documented to allow them to be reused in other
modules.</p>
<dl class="class">
<dt id="pyslet.odata2.csdl.NameTableMixin">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NameTableMixin</tt><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike" title="pyslet.odata2.csdl.DictionaryLike"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.DictionaryLike</span></tt></a></p>
<p>A mix-in class to help other objects become named scopes.</p>
<p>Using this mix-in the class behaves like a read-only named
dictionary with string keys and object values.  If the dictionary
contains a value that is itself a NameTableMixin then keys can be
compounded to look-up items in sub-scopes.</p>
<p>For example, if the name table contains a value with key &#8220;X&#8221; that is
itself a name table containing a value with key &#8220;Y&#8221; then both &#8220;X&#8221;
and &#8220;X.Y&#8221; are valid keys, the latter performing a &#8216;deep lookup&#8217; in
the nested scope.</p>
<dl class="attribute">
<dt id="pyslet.odata2.csdl.NameTableMixin.name">
<tt class="descname">name</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.name" title="Permalink to this definition">¶</a></dt>
<dd><p>the name of this name table (in the context of its parent)</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.NameTableMixin.nameTable">
<tt class="descname">nameTable</tt><em class="property"> = None</em><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.nameTable" title="Permalink to this definition">¶</a></dt>
<dd><p>a dictionary mapping names to child objects</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NameTableMixin.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>Looks up <em>key</em> in <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin.nameTable" title="pyslet.odata2.csdl.NameTableMixin.nameTable"><tt class="xref py py-attr docutils literal"><span class="pre">nameTable</span></tt></a> and, if not found, in
each child scope with a name that is a valid scope prefix of
key.  For example, if key is &#8220;My.Scope.Name&#8221; then a child scope
with name &#8220;My.Scope&#8221; would be searched for &#8220;Name&#8221; or a child
scope with name &#8220;My&#8221; would be searched for &#8220;Scope.Name&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NameTableMixin.__iter__">
<tt class="descname">__iter__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.__iter__" title="Permalink to this definition">¶</a></dt>
<dd><p>Yields all keys defined in this scope and all compounded keys
from nested scopes.  For example, a child scope with name
&#8220;My.Scope&#8221; which itself has a child &#8220;Name&#8221; would generate two
keys: &#8220;My.Scope&#8221; and &#8220;My.Scope.Name&#8221;.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NameTableMixin.__len__">
<tt class="descname">__len__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.__len__" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of keys in this scope including all
compounded keys from nested scopes.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NameTableMixin.Declare">
<tt class="descname">Declare</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.Declare" title="Permalink to this definition">¶</a></dt>
<dd><p>Declares a value in this named scope.</p>
<p><em>value</em> must have a name attribute which is used to declare it
in the scope; duplicate keys are not allowed and will raise
<tt class="xref py py-class docutils literal"><span class="pre">DuplicateKey</span></tt>.</p>
<p>Values are always declared in the top-level scope, even if they
contain the compounding character &#8216;.&#8217;, however, you cannot
declare &#8220;X&#8221; if you have already declared &#8220;X.Y&#8221; and vice versa.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.NameTableMixin.Undeclare">
<tt class="descname">Undeclare</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.NameTableMixin.Undeclare" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes a value from the named scope.</p>
<p>Values can only be removed from the top-level scope.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DictionaryLike">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DictionaryLike</tt><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>An abstract class for behaving like a dictionary.</p>
<p>Derived classes must override <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__iter__" title="pyslet.odata2.csdl.DictionaryLike.__iter__"><tt class="xref py py-meth docutils literal"><span class="pre">__iter__()</span></tt></a> and <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__getitem__" title="pyslet.odata2.csdl.DictionaryLike.__getitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__getitem__()</span></tt></a>
and if the dictionary is writable <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__setitem__" title="pyslet.odata2.csdl.DictionaryLike.__setitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__setitem__()</span></tt></a> and probably
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__delitem__" title="pyslet.odata2.csdl.DictionaryLike.__delitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__delitem__()</span></tt></a> too.  These methods all raise NotImplementedError by
default.</p>
<p>Dervied classes should also override <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__len__" title="pyslet.odata2.csdl.DictionaryLike.__len__"><tt class="xref py py-meth docutils literal"><span class="pre">__len__()</span></tt></a> and
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.clear" title="pyslet.odata2.csdl.DictionaryLike.clear"><tt class="xref py py-meth docutils literal"><span class="pre">clear()</span></tt></a> as the default implementations are inefficient.</p>
<p>A note on thread safety.  Unlike native Python dictionaries,
DictionaryLike objects can not be treated as thread safe for
updates.  The implementations of the read-only methods (including
the iterators) are designed to be thread safe so, once populated,
they can be safely shared.  Derived classes should honour this
contract when implementing <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__iter__" title="pyslet.odata2.csdl.DictionaryLike.__iter__"><tt class="xref py py-meth docutils literal"><span class="pre">__iter__()</span></tt></a>,
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__getitem__" title="pyslet.odata2.csdl.DictionaryLike.__getitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__getitem__()</span></tt></a> and <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__len__" title="pyslet.odata2.csdl.DictionaryLike.__len__"><tt class="xref py py-meth docutils literal"><span class="pre">__len__()</span></tt></a> or clearly document
that the object is not thread-safe at all.</p>
<p>Finally, one other difference worth noting is touched on in a comment
from the following question on Stack Overflow:
<a class="reference external" href="http://stackoverflow.com/questions/3358770/python-dictionary-is-thread-safe">http://stackoverflow.com/questions/3358770/python-dictionary-is-thread-safe</a></p>
<p>This question is about whether a dictionary can be modified during
iteration.  Although not typically a thread-safety issue the commenter
says:</p>
<blockquote>
<div>I think they are related. What if one thread iterates and the
other modifies the dict?</div></blockquote>
<p>To recap, native Python dictionaries limit the modifications you can make
during iteration, quoting from the docs:</p>
<blockquote>
<div>The dictionary p should not be mutated during iteration. It is
safe (since Python 2.1) to modify the values of the keys as you
iterate over the dictionary, but only so long as the set of keys
does not change</div></blockquote>
<p>You should treat DictionaryLike objects with the same respect but
the behaviour is not defined at this abstract class level and will
vary depending on the implementation.  Derived classes are only
dictionary-like, they are not actually Python dictionaries!</p>
<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements self[key]</p>
<p>This method must be overridden to make a concrete implementation</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__setitem__">
<tt class="descname">__setitem__</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__setitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements assignment to self[key]</p>
<p>This method must be overridden if you want your dictionary-like
object to be writeable.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__delitem__">
<tt class="descname">__delitem__</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__delitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements del self[key]</p>
<p>This method should be overridden if you want your
dictionary-like object to be writeable.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__iter__">
<tt class="descname">__iter__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__iter__" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an object that implements the iterable protocol on the keys</p>
<p>This method must be overridden to make a concrete implementation</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__len__">
<tt class="descname">__len__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__len__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements len(self)</p>
<p>The default implementation simply counts the keys returned by __iter__
and should be overridden with a more efficient implementation if
available.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.__contains__">
<tt class="descname">__contains__</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__contains__" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements: key in self</p>
<p>The default implementation uses __getitem__ and returns False if it
raises a KeyError.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.iterkeys">
<tt class="descname">iterkeys</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.iterkeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterable of the keys, simple calls __iter__</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.itervalues">
<tt class="descname">itervalues</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.itervalues" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterable of the values.</p>
<p>The default implementation is a generator function that iterates
over the keys and uses __getitem__ to yield each value.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.keys">
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.keys" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of keys.</p>
<p>This is a copy of the keys in no specific order.  Modifications to this
list do not affect the object.  The default implementation uses
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.iterkeys" title="pyslet.odata2.csdl.DictionaryLike.iterkeys"><tt class="xref py py-meth docutils literal"><span class="pre">iterkeys()</span></tt></a></p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.values">
<tt class="descname">values</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.values" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of values.</p>
<p>This is a copy of the values in no specific order.  Modifications to
this list do not affect the object.  The default implementation uses
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.itervalues" title="pyslet.odata2.csdl.DictionaryLike.itervalues"><tt class="xref py py-meth docutils literal"><span class="pre">itervalues()</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.iteritems">
<tt class="descname">iteritems</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.iteritems" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterable of the key,value pairs.</p>
<p>The default implementation is a generator function that uses
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.__iter__" title="pyslet.odata2.csdl.DictionaryLike.__iter__"><tt class="xref py py-meth docutils literal"><span class="pre">__iter__()</span></tt></a> and __getitem__ to yield the pairs.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.items">
<tt class="descname">items</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.items" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of key,value pair tuples.</p>
<p>This is a copy of the items in no specific order.  Modifications to this
list do not affect the object.  The default implementation uses
<a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.iteritems" title="pyslet.odata2.csdl.DictionaryLike.iteritems"><tt class="xref py py-class docutils literal"><span class="pre">iteritems</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.has_key">
<tt class="descname">has_key</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.has_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to: key in self</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.get">
<tt class="descname">get</tt><big>(</big><em>key</em>, <em>default=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to: self[key] if key in self else default.</p>
<p>Implemented using __getitem__</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.setdefault">
<tt class="descname">setdefault</tt><big>(</big><em>key</em>, <em>value=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.setdefault" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to: self[key] if key in self else value; ensuring
self[key]=value</p>
<p>Implemented using __getitem__ and __setitem__.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.pop">
<tt class="descname">pop</tt><big>(</big><em>key</em>, <em>value=None</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to: self[key] if key in self else value; ensuring key not
in self.</p>
<p>Implemented using __getitem__ and __delitem__.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.clear">
<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes all items from the object.</p>
<p>The default implementation uses <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.keys" title="pyslet.odata2.csdl.DictionaryLike.keys"><tt class="xref py py-meth docutils literal"><span class="pre">keys()</span></tt></a> and deletes the items
one-by-one with __delitem__.  It does this to avoid deleting objects
while iterating as the results are generally undefined.  A more
efficient implementation is recommended.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.popitem">
<tt class="descname">popitem</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.popitem" title="Permalink to this definition">¶</a></dt>
<dd><p>Equivalent to: self[key] for some random key; removing key.</p>
<p>This is a rather odd implementation but to avoid iterating over
the whole object we create an iterator with __iter__, use
__getitem__ once and then discard it.  If an object is found we
use __delitem__ to delete it, otherwise KeyError is raised.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.bigclear">
<tt class="descname">bigclear</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.bigclear" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes all the items from the object (alternative for large
dictionary-like objects).</p>
<p>This is an alternative implementation more suited to objects with very
large numbers of keys.  It uses <a class="reference internal" href="#pyslet.odata2.csdl.DictionaryLike.popitem" title="pyslet.odata2.csdl.DictionaryLike.popitem"><tt class="xref py py-meth docutils literal"><span class="pre">popitem()</span></tt></a> repeatedly until
KeyError is raised.  The downside is that popitem creates (and discards)
one iterator object for each item it removes.  The upside is that we
never load the list of keys into memory.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a shallow copy of this object.</p>
<p>This method must be overridden if you want your dictionary-like
object to support the copy operation.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.odata2.csdl.DictionaryLike.update">
<tt class="descname">update</tt><big>(</big><em>items</em><big>)</big><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates through <em>items</em> using __setitem__ to add them to the
set.</p>
</dd></dl>

<dl class="attribute">
<dt id="pyslet.odata2.csdl.DictionaryLike.__weakref__">
<tt class="descname">__weakref__</tt><a class="headerlink" href="#pyslet.odata2.csdl.DictionaryLike.__weakref__" title="Permalink to this definition">¶</a></dt>
<dd><p>list of weak references to the object (if defined)</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="exceptions">
<h2>2.1.3.1.5. Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.odata2.csdl.NonExistentEntity">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NonExistentEntity</tt><a class="headerlink" href="#pyslet.odata2.csdl.NonExistentEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>Raised when attempting to perform a restricted operation on an
entity that doesn&#8217;t exist yet.  For example, getting the value of a
navigation property.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.EntityExists">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EntityExists</tt><a class="headerlink" href="#pyslet.odata2.csdl.EntityExists" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>Raised when attempting to perform a restricted operation on an
entity that already exists.  For example, inserting it into the base
collection.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ConstraintError">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ConstraintError</tt><a class="headerlink" href="#pyslet.odata2.csdl.ConstraintError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>General error raised when a constraint has been violated.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.NavigationError">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">NavigationError</tt><a class="headerlink" href="#pyslet.odata2.csdl.NavigationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.ConstraintError" title="pyslet.odata2.csdl.ConstraintError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.ConstraintError</span></tt></a></p>
<p>Raised when attempting to perform an operation on an entity and a
violation of a navigation property&#8217;s relationship is encountered. 
For example, adding multiple links when only one is allowed or
failing to add a link when one is required.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ConcurrencyError">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ConcurrencyError</tt><a class="headerlink" href="#pyslet.odata2.csdl.ConcurrencyError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.ConstraintError" title="pyslet.odata2.csdl.ConstraintError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.ConstraintError</span></tt></a></p>
<p>Raised when attempting to perform an update on an entity and a violation
of a concurrency control constraint is encountered.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ModelIncomplete">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ModelIncomplete</tt><a class="headerlink" href="#pyslet.odata2.csdl.ModelIncomplete" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>Raised when a model element has a missing reference.</p>
<p>For example, an
<a class="reference internal" href="#pyslet.odata2.csdl.EntitySet" title="pyslet.odata2.csdl.EntitySet"><tt class="xref py py-class docutils literal"><span class="pre">EntitySet</span></tt></a> that is bound to an undeclared
:<a class="reference internal" href="#pyslet.odata2.csdl.EntityType" title="pyslet.odata2.csdl.EntityType"><tt class="xref py py-class docutils literal"><span class="pre">EntityType</span></tt></a>.</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.ModelConstraintError">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">ModelConstraintError</tt><a class="headerlink" href="#pyslet.odata2.csdl.ModelConstraintError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>Raised when an issue in the model other than completeness
prevents an action being performed.</p>
<p>For example, an entity type that is dependent on two unbound
principals (so can never be inserted).</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.DuplicateName">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">DuplicateName</tt><a class="headerlink" href="#pyslet.odata2.csdl.DuplicateName" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.EDMError" title="pyslet.odata2.csdl.EDMError"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.EDMError</span></tt></a></p>
<p>Raised by <a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> when attempting to declare a name in
a context where the name is already declared.</p>
<p>This might be raised if your metadata document incorrectly defines
two objects with the same name in the same scope, for example</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.IncompatibleNames">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">IncompatibleNames</tt><a class="headerlink" href="#pyslet.odata2.csdl.IncompatibleNames" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.odata2.csdl.DuplicateName" title="pyslet.odata2.csdl.DuplicateName"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.odata2.csdl.DuplicateName</span></tt></a></p>
<p>A special type of <a class="reference internal" href="#pyslet.odata2.csdl.DuplicateName" title="pyslet.odata2.csdl.DuplicateName"><tt class="xref py py-class docutils literal"><span class="pre">DuplicateName</span></tt></a> exception raised by
<a class="reference internal" href="#pyslet.odata2.csdl.NameTableMixin" title="pyslet.odata2.csdl.NameTableMixin"><tt class="xref py py-class docutils literal"><span class="pre">NameTableMixin</span></tt></a> when attempting to declare a name which
might hide, or be hidden by, another name already declared.</p>
<p>CSDL&#8217;s definition of SimpleIdentifier allows &#8216;.&#8217; to be used in names but
also uses it for qualifying names.  As a result, it is possible to define a
scope with a name like &#8220;My.Scope&#8221; which precludes the later definition of a
scope called simply &#8220;My&#8221; (and vice versa).</p>
</dd></dl>

<dl class="class">
<dt id="pyslet.odata2.csdl.EDMError">
<em class="property">class </em><tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EDMError</tt><a class="headerlink" href="#pyslet.odata2.csdl.EDMError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></p>
<p>General exception for all CSDL model errors.</p>
</dd></dl>

<div class="section" id="constants">
<h3>2.1.3.1.5.1. Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h3>
<dl class="data">
<dt id="pyslet.odata2.csdl.EDM_NAMESPACE">
<tt class="descclassname">pyslet.odata2.csdl.</tt><tt class="descname">EDM_NAMESPACE</tt><em class="property"> = 'http://schemas.microsoft.com/ado/2009/11/edm'</em><a class="headerlink" href="#pyslet.odata2.csdl.EDM_NAMESPACE" title="Permalink to this definition">¶</a></dt>
<dd><p>Namespace to use for CSDL elements</p>
</dd></dl>

</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">2.1.3.1. Entity Data Model (EDM)</a><ul>
<li><a class="reference internal" href="#data-model">2.1.3.1.1. Data Model</a><ul>
<li><a class="reference internal" href="#primitive-simpletypes">2.1.3.1.1.1. Primitive SimpleTypes</a></li>
<li><a class="reference internal" href="#complex-types">2.1.3.1.1.2. Complex Types</a></li>
<li><a class="reference internal" href="#navigation-deferred-values">2.1.3.1.1.3. Navigation: Deferred Values</a></li>
<li><a class="reference internal" href="#supporting-classes">2.1.3.1.1.4. Supporting Classes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#metadata-model">2.1.3.1.2. Metadata Model</a></li>
<li><a class="reference internal" href="#misc-definitions">2.1.3.1.3. Misc Definitions</a></li>
<li><a class="reference internal" href="#utility-classes">2.1.3.1.4. Utility Classes</a></li>
<li><a class="reference internal" href="#exceptions">2.1.3.1.5. Exceptions</a><ul>
<li><a class="reference internal" href="#constants">2.1.3.1.5.1. Constants</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="odatav2_reference.html"
                        title="previous chapter">2.1.3. OData Reference</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="odatav2_core.html"
                        title="next chapter">2.1.3.2. OData Core Classes</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/odatav2_csdl.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="odatav2_core.html" title="2.1.3.2. OData Core Classes"
             >next</a> |</li>
        <li class="right" >
          <a href="odatav2_reference.html" title="2.1.3. OData Reference"
             >previous</a> |</li>
        <li><a href="index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="general.html" >2. Supporting Standards</a> &raquo;</li>
          <li><a href="odatav2.html" >2.1. The Open Data Protocol (OData)</a> &raquo;</li>
          <li><a href="odatav2_reference.html" >2.1.3. OData Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright ©2008-2014, Steve Lay.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
    </div>
  </body>
</html>